diff --git a/src/components/menu/item/item.module.css b/src/components/menu/item/item.module.css index 1f3083b..45ffb8a 100644 --- a/src/components/menu/item/item.module.css +++ b/src/components/menu/item/item.module.css @@ -4,7 +4,8 @@ align-items: center; justify-content: flex-start; width: 100%; - padding: 16px 12px; + height: 50px; + padding: 0 12px; font-size: var(--font-sm); font-weight: 500; line-height: 1; diff --git a/src/components/menu/items/index.ts b/src/components/menu/items/index.ts index 63eaf2f..f388bc2 100644 --- a/src/components/menu/items/index.ts +++ b/src/components/menu/items/index.ts @@ -1,3 +1,4 @@ export { Shuffle as ShuffleItem } from './shuffle'; export { Share as ShareItem } from './share'; export { Donate as DonateItem } from './donate'; +export { Notepad as NotepadItem } from './notepad'; diff --git a/src/components/menu/items/notepad.tsx b/src/components/menu/items/notepad.tsx new file mode 100644 index 0000000..df68e09 --- /dev/null +++ b/src/components/menu/items/notepad.tsx @@ -0,0 +1,11 @@ +import { MdNotes } from 'react-icons/md/index'; + +import { Item } from '../item'; + +interface NotepadProps { + open: () => void; +} + +export function Notepad({ open }: NotepadProps) { + return } label="Notepad" onClick={open} />; +} diff --git a/src/components/menu/menu.tsx b/src/components/menu/menu.tsx index f9470f7..95880fb 100644 --- a/src/components/menu/menu.tsx +++ b/src/components/menu/menu.tsx @@ -14,8 +14,9 @@ import { FloatingFocusManager, } from '@floating-ui/react'; -import { ShuffleItem, ShareItem, DonateItem } from './items'; +import { ShuffleItem, ShareItem, DonateItem, NotepadItem } from './items'; import { ShareLinkModal } from '@/components/modals/share-link'; +import { Notepad } from '@/components/toolbox'; import { slideY, fade, mix } from '@/lib/motion'; @@ -25,6 +26,7 @@ export function Menu() { const [isOpen, setIsOpen] = useState(false); const [showShareLink, setShowShareLink] = useState(false); + const [showNotepad, setShowNotepad] = useState(false); const variants = mix(slideY(-20), fade()); @@ -76,6 +78,7 @@ export function Menu() { > setShowShareLink(true)} /> + setShowNotepad(true)} /> @@ -88,6 +91,8 @@ export function Menu() { show={showShareLink} onClose={() => setShowShareLink(false)} /> + + setShowNotepad(false)} /> ); } diff --git a/src/components/modal/modal.module.css b/src/components/modal/modal.module.css index 702c558..0dbf4f1 100644 --- a/src/components/modal/modal.module.css +++ b/src/components/modal/modal.module.css @@ -29,6 +29,13 @@ background-color: var(--color-neutral-100); border-radius: 8px; + &.wide { + width: 95%; + max-width: 600px; + padding: 12px; + padding-top: 40px; + } + & .close { position: absolute; top: 10px; diff --git a/src/components/modal/modal.tsx b/src/components/modal/modal.tsx index c8b2824..e75e809 100644 --- a/src/components/modal/modal.tsx +++ b/src/components/modal/modal.tsx @@ -2,6 +2,7 @@ import { AnimatePresence, motion } from 'framer-motion'; import { IoClose } from 'react-icons/io5/index'; import { fade, mix, slideY } from '@/lib/motion'; +import { cn } from '@/helpers/styles'; import styles from './modal.module.css'; @@ -9,9 +10,10 @@ interface ModalProps { children: React.ReactNode; onClose: () => void; show: boolean; + wide?: boolean; } -export function Modal({ children, onClose, show }: ModalProps) { +export function Modal({ children, onClose, show, wide }: ModalProps) { const variants = { modal: mix(fade(), slideY(20)), overlay: fade(), @@ -33,7 +35,7 @@ export function Modal({ children, onClose, show }: ModalProps) {
{ useSoundStore.persist.rehydrate(); + useNoteStore.persist.rehydrate(); }, []); return <>{children}; diff --git a/src/components/toolbox/index.ts b/src/components/toolbox/index.ts new file mode 100644 index 0000000..8a3fad5 --- /dev/null +++ b/src/components/toolbox/index.ts @@ -0,0 +1 @@ +export { Notepad } from './notepad'; diff --git a/src/components/toolbox/notepad/index.ts b/src/components/toolbox/notepad/index.ts new file mode 100644 index 0000000..8a3fad5 --- /dev/null +++ b/src/components/toolbox/notepad/index.ts @@ -0,0 +1 @@ +export { Notepad } from './notepad'; diff --git a/src/components/toolbox/notepad/notepad.module.css b/src/components/toolbox/notepad/notepad.module.css new file mode 100644 index 0000000..d9f53a3 --- /dev/null +++ b/src/components/toolbox/notepad/notepad.module.css @@ -0,0 +1,26 @@ +.header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 8px; + + & .label { + font-size: var(--font-sm); + font-weight: 500; + color: var(--color-foreground-subtle); + } +} + +.textarea { + width: 100%; + height: 350px; + padding: 12px; + line-height: 1.6; + color: var(--color-foreground-subtle); + resize: none; + background-color: var(--color-neutral-50); + border: 1px solid var(--color-neutral-200); + border-radius: 4px; + outline: none; + scroll-padding-bottom: 12px; +} diff --git a/src/components/toolbox/notepad/notepad.tsx b/src/components/toolbox/notepad/notepad.tsx new file mode 100644 index 0000000..90ddeaa --- /dev/null +++ b/src/components/toolbox/notepad/notepad.tsx @@ -0,0 +1,29 @@ +import { Modal } from '@/components/modal'; + +import styles from './notepad.module.css'; +import { useNoteStore } from '@/store'; + +interface NotepadProps { + onClose: () => void; + show: boolean; +} + +export function Notepad({ onClose, show }: NotepadProps) { + const note = useNoteStore(state => state.note); + const write = useNoteStore(state => state.write); + + return ( + +
+

Your Note

+
+ +