Skip to content

Commit

Permalink
refactor: move shared atoms into one file
Browse files Browse the repository at this point in the history
  • Loading branch information
johnshift committed May 14, 2024
1 parent 11d95f1 commit 69b9727
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { atom } from 'jotai';

export const showFullscreenNavAtom = atom<boolean>(false);

export const initPathAtom = atom<string | null>(null);
2 changes: 1 addition & 1 deletion src/shared/components/menu-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Button } from '@nextui-org/button';
import { useSetAtom } from 'jotai';

import { showFullscreenNavAtom } from '@/shared/atoms/show-fullscreen-nav-atom';
import { showFullscreenNavAtom } from '@/shared/atoms';

export const MenuButton = () => {
const setShowNav = useSetAtom(showFullscreenNavAtom);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/nav/fullscreen-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useAtomValue } from 'jotai';

import { showFullscreenNavAtom } from '@/shared/atoms/show-fullscreen-nav-atom';
import { showFullscreenNavAtom } from '@/shared/atoms';

interface Props {
children: React.ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/nav/use-close-nav.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useAtom } from 'jotai';

import { showFullscreenNavAtom } from '@/shared/atoms/show-fullscreen-nav-atom';
import { showFullscreenNavAtom } from '@/shared/atoms';

export const useCloseNav = () => {
const [showNav, setShowNav] = useAtom(showFullscreenNavAtom);
Expand Down

0 comments on commit 69b9727

Please sign in to comment.