Skip to content

Commit 6321bf5

Browse files
committed
Remove unnecessary code and home page
1 parent 8c877da commit 6321bf5

File tree

5 files changed

+21
-50
lines changed

5 files changed

+21
-50
lines changed

frontend/app/components/diff-viewer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export default function DiffViewer({ file1, file2, onClose }: DiffViewerProps) {
6161
setDiffTree(result)
6262
setIsLoading(false)
6363
})
64-
// const result = generateUnifiedDiff(file1.content, file2.content)
6564

6665
}, [file1, file2])
6766

frontend/app/components/navbar.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ export default function Navbar() {
1010
<Shield className="h-6 w-6 text-primary" />
1111
<span className="text-xl font-bold">API Protector</span>
1212
</NavLink>
13-
<nav className="hidden md:flex items-center space-x-6">
14-
<NavLink to="/" className="text-sm text-gray-600 hover:text-primary">
15-
Home
16-
</NavLink>
17-
<NavLink to="/compare" className="text-sm text-gray-600 hover:text-primary">
18-
Compare
19-
</NavLink>
20-
</nav>
13+
{/*<nav className="hidden md:flex items-center space-x-6">*/}
14+
{/* <NavLink to="/" className="text-sm text-gray-600 hover:text-primary">*/}
15+
{/* Home*/}
16+
{/* </NavLink>*/}
17+
{/* <NavLink to="/compare" className="text-sm text-gray-600 hover:text-primary">*/}
18+
{/* Compare*/}
19+
{/* </NavLink>*/}
20+
{/*</nav>*/}
2121
</div>
2222
</div>
2323
</header>

frontend/app/routes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import {type RouteConfig, index, route} from "@react-router/dev/routes";
1+
import {type RouteConfig, index} from "@react-router/dev/routes";
22

33
export default [
44
index("routes/home.tsx"),
5-
route("compare", "routes/compare.tsx"),
65
] satisfies RouteConfig;

frontend/app/routes/compare.tsx

Lines changed: 0 additions & 20 deletions
This file was deleted.

frontend/app/routes/home.tsx

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
1+
import FileComparisonTool from "~/components/file-comparison-tool"
12
import type { Route } from "./+types/home";
2-
import {useEffect, useState} from "react";
3-
import { Button } from "~/components/ui/button"
43

54
export function meta({}: Route.MetaArgs) {
65
return [
7-
{ title: "API Protector" },
8-
{ name: "description", content: "Welcome to React Router!" },
6+
{ title: "API Protector - File Comparison" },
7+
{ name: "Comparator", content: "Compare JSON and YAML files to identify differences" },
98
];
109
}
1110

12-
export default function Home() {
13-
const [hello, setHello] = useState("Waiting for hello!");
14-
15-
const getHello = async () => {
16-
const response = await fetch("/api/v1/hello");
17-
response.text().then((data)=>setHello(data));
18-
};
19-
20-
useEffect(() => {
21-
getHello();
22-
}, []);
23-
11+
export default function ComparePage() {
2412
return (
25-
<h1 className="text-3xl font-bold mb-6"><Button onClick={getHello}>{hello}</Button></h1>
26-
);
27-
}
13+
<>
14+
<h1 className="text-3xl font-bold mb-6">File Comparison Tool</h1>
15+
<p className="text-gray-600 mb-8">Upload two JSON or YAML files to compare their structure and content.</p>
16+
<FileComparisonTool />
17+
</>
18+
)
19+
}
20+

0 commit comments

Comments
 (0)