Skip to content

Commit dc515b8

Browse files
committed
restructure components, fix search issue and add react compiler
1 parent 9fe9341 commit dc515b8

15 files changed

Lines changed: 1089 additions & 66 deletions

File tree

package-lock.json

Lines changed: 1012 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,36 @@
1818
"@react-router/serve": "^7.13.1",
1919
"class-variance-authority": "^0.7.1",
2020
"clsx": "^2.1.1",
21+
"i18next": "^25.8.18",
2122
"isbot": "^5.1.35",
2223
"lucide-react": "^0.577.0",
2324
"object-path": "^0.11.8",
2425
"react": "^19.2.4",
2526
"react-dom": "^19.2.4",
27+
"react-i18next": "^16.5.8",
2628
"react-router": "^7.13.1",
2729
"tailwind-merge": "^3.5.0",
2830
"vaul": "^1.1.2",
2931
"zod": "^4.3.6"
3032
},
3133
"devDependencies": {
34+
"@babel/preset-typescript": "^7.28.5",
3235
"@biomejs/biome": "^2.4.6",
3336
"@react-router/dev": "^7.13.1",
3437
"@tailwindcss/vite": "^4.2.1",
3538
"@types/node": "^25.4.0",
3639
"@types/object-path": "^0.11.4",
3740
"@types/react": "^19.2.14",
3841
"@types/react-dom": "^19.2.3",
42+
"babel-plugin-react-compiler": "^1.0.0",
3943
"picocolors": "^1.1.1",
44+
"react-router-devtools": "^6.2.0",
4045
"shadcn": "^4.0.3",
4146
"tailwindcss": "^4.2.1",
4247
"tw-animate-css": "^1.4.0",
4348
"typescript": "^5.9.3",
4449
"vite": "^7.3.1",
50+
"vite-plugin-babel": "^1.5.1",
4551
"vite-tsconfig-paths": "^6.1.1"
4652
}
4753
}

src/app.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { AppWindowIcon, CodeIcon } from "lucide-react";
2-
import React, { Suspense } from "react";
3-
import { FileExplorer } from "@/components/features/file-explorer/file-explorer";
2+
import { FileExplorer } from "@/components/features/file-explorer";
43
import { Hero } from "@/components/global/hero";
54
import { Main } from "@/components/global/main";
65
import { NavBar } from "@/components/global/navbar";
@@ -11,10 +10,7 @@ import { SearchProvider } from "@/contexts/search";
1110
import { SettingsProvider } from "@/contexts/settings";
1211
import { ThemeProvider } from "@/contexts/theme";
1312
import { parseTemplate } from "@/lib/client/nginx";
14-
15-
const SettingsMenu = React.lazy(
16-
() => import("./components/global/settings-menu"),
17-
);
13+
import { Settings } from "./components/global/settings";
1814

1915
const App: React.FC = () => {
2016
const { path, files } = parseTemplate();
@@ -24,9 +20,7 @@ const App: React.FC = () => {
2420
<SettingsProvider>
2521
<ThemeProvider storageKey={import.meta.env.VITE_THEME_STORAGE_KEY}>
2622
<SearchProvider debounceMs={500} initialMode="local">
27-
<Suspense>
28-
<SettingsMenu />
29-
</Suspense>
23+
<Settings />
3024
<NavBar />
3125
<Hero />
3226
<Main path={path}>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { useSearch } from "@/hooks/search";
2+
import { FileTable } from "./file-table";
3+
import { SearchResultTable } from "./search-result-table";
4+
import { useEffect, useState } from "react";
5+
6+
export const FileExplorer: React.FC = () => {
7+
const { query } = useSearch();
8+
const [active, setActive] = useState(() => query.trim().length > 0);
9+
10+
useEffect(() => {
11+
setActive(query.trim().length > 0);
12+
}, [query]);
13+
14+
return (
15+
<>
16+
<div className={active ? "hidden" : ""}>
17+
<FileTable />
18+
</div>
19+
<div className={active ? "" : "hidden"}>
20+
<SearchResultTable />
21+
</div>
22+
</>
23+
)
24+
};

src/components/features/file-explorer/file-table.tsx renamed to src/components/features/file-explorer/components/file-table.tsx

File renamed without changes.

src/components/features/file-explorer/search-result-table.tsx renamed to src/components/features/file-explorer/components/search-result-table.tsx

File renamed without changes.

src/components/features/file-explorer/file-explorer.tsx

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { FileExplorer } from "./components/file-explorer";

src/components/global/search.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ export const Search: React.FC = () => {
1717
}, [query]);
1818

1919
useEffect(() => {
20-
if (search !== query) {
21-
setQuery(search);
22-
}
23-
}, [search, query, setQuery]);
20+
setQuery(search);
21+
}, [search, setQuery]);
2422

2523
const id = useId();
2624

src/components/global/settings-menu.tsx renamed to src/components/global/settings/components/settings-drawer.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface CheckboxFieldProps {
2424
update: (key: string, value: unknown) => unknown;
2525
}
2626

27-
export const SettingsMenu: React.FC = () => {
27+
export const SettingsDrawer: React.FC = () => {
2828
const { settings, update, active, toggle } = useSettings();
2929

3030
return (
@@ -95,5 +95,3 @@ const CheckboxField: React.FC<CheckboxFieldProps> = ({
9595
</FieldLabel>
9696
</Field>
9797
);
98-
99-
export default SettingsMenu;

0 commit comments

Comments
 (0)