Skip to content

Commit b262865

Browse files
author
ndthanhdev
committed
update main layout
1 parent 3b9cf0b commit b262865

21 files changed

Lines changed: 390 additions & 51 deletions
8.79 KB
Binary file not shown.
4.76 KB
Binary file not shown.
184 KB
Binary file not shown.
Binary file not shown.
110 KB
Binary file not shown.

.yarn/install-state.gz

8.75 KB
Binary file not shown.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@
4545
"ramda": "^0.29.0",
4646
"react": "^18.2.0",
4747
"react-dom": "^18.2.0",
48+
"rooks": "^7.14.1",
4849
"sass": "^1.66.1",
4950
"theme-ui-sketchy-preset": "^0.1.3",
50-
"type-fest": "^4.3.1"
51+
"type-fest": "^4.3.1",
52+
"zustand": "^4.4.1"
5153
},
5254
"devDependencies": {
5355
"@sindresorhus/slugify": "^2.2.1",

src/layouts/home.tsx

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

src/layouts/main/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./main-container";
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { SettingContainer, useSettings } from "../settings";
2+
import { MainLayout } from "./main";
3+
import { createStore } from "zustand";
4+
5+
export const useMainLayout = createStore((set) => ({
6+
openSettings: false,
7+
setOpenSettings: (open: boolean) => set({ openSettings: open }),
8+
}));
9+
10+
export type MainLayoutContainerProps = React.PropsWithChildren<{}>;
11+
12+
export const MainLayoutContainer = ({ children }: MainLayoutContainerProps) => {
13+
const settings = useSettings();
14+
15+
return (
16+
<MainLayout onOpenSettings={() => settings.setOpen(true)}>
17+
<SettingContainer />
18+
{children}
19+
</MainLayout>
20+
);
21+
};

0 commit comments

Comments
 (0)