diff --git a/pkgs/frontend/app/components/CommonDialog.tsx b/pkgs/frontend/app/components/CommonDialog.tsx new file mode 100644 index 0000000..b1d2730 --- /dev/null +++ b/pkgs/frontend/app/components/CommonDialog.tsx @@ -0,0 +1,22 @@ +import { + DialogContent, + DialogRoot, + DialogTrigger, +} from "~/components/ui/dialog"; + +interface CommonDialogProps { + dialogTriggerReactNode?: React.ReactNode; + children?: React.ReactNode; +} + +export const CommonDialog = ({ + dialogTriggerReactNode, + children, +}: CommonDialogProps) => { + return ( + + {dialogTriggerReactNode} + {children} + + ); +}; diff --git a/pkgs/frontend/app/components/CommonInput.tsx b/pkgs/frontend/app/components/CommonInput.tsx new file mode 100644 index 0000000..df992c5 --- /dev/null +++ b/pkgs/frontend/app/components/CommonInput.tsx @@ -0,0 +1,10 @@ +import { Input, InputProps } from "@chakra-ui/react"; + +interface CommonInputProps extends Omit { + value: string | number; + onChange: (event: React.ChangeEvent) => void; +} + +export const CommonInput = ({ value, onChange }: CommonInputProps) => { + return ; +}; diff --git a/pkgs/frontend/app/components/CommonTextarea.tsx b/pkgs/frontend/app/components/CommonTextarea.tsx new file mode 100644 index 0000000..5704cad --- /dev/null +++ b/pkgs/frontend/app/components/CommonTextarea.tsx @@ -0,0 +1,10 @@ +import { Textarea, TextareaProps } from "@chakra-ui/react"; + +interface CommonTextAreaProps extends Omit { + value: string; + onChange: (event: React.ChangeEvent) => void; +} + +export const CommonTextArea = ({ value, onChange }: CommonTextAreaProps) => { + return ; +}; diff --git a/pkgs/frontend/app/components/Input.tsx b/pkgs/frontend/app/components/Input.tsx deleted file mode 100644 index fdce19d..0000000 --- a/pkgs/frontend/app/components/Input.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { - Input as ChakraInput, - InputProps as ChakraInputProps, -} from "@chakra-ui/react"; - -interface InputProps extends Omit { - value: string | number; - onChange: (event: React.ChangeEvent) => void; -} - -export const Input = ({ value, onChange }: InputProps) => { - return ; -}; diff --git a/pkgs/frontend/app/components/TextArea.tsx b/pkgs/frontend/app/components/TextArea.tsx deleted file mode 100644 index 12257f7..0000000 --- a/pkgs/frontend/app/components/TextArea.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { - Textarea as ChakraTextarea, - TextareaProps as ChakraTextareaProps, -} from "@chakra-ui/react"; - -interface TextAreaProps extends Omit { - value: string; - onChange: (event: React.ChangeEvent) => void; -} - -export const TextArea = ({ value, onChange }: TextAreaProps) => { - return ; -}; diff --git a/pkgs/frontend/app/routes/_index.tsx b/pkgs/frontend/app/routes/_index.tsx index ef132ae..b1c370e 100644 --- a/pkgs/frontend/app/routes/_index.tsx +++ b/pkgs/frontend/app/routes/_index.tsx @@ -1,4 +1,3 @@ -import { useState } from "react"; import { Box, Button, @@ -11,11 +10,17 @@ import { Skeleton, VStack, } from "@chakra-ui/react"; +import { + DialogActionTrigger, + DialogBody, + DialogCloseTrigger, + DialogFooter, + DialogHeader, + DialogTitle, +} from "~/components/ui/dialog"; import type { MetaFunction } from "@remix-run/node"; import { ColorModeToggle } from "../components/color-mode-toggle"; -import { Input } from "~/components/Input"; -import { TextArea } from "~/components/TextArea"; -import { CommonButton } from "~/components/CommonButton"; +import { CommonDialog } from "~/components/CommonDialog"; export const meta: MetaFunction = () => { return [ @@ -24,26 +29,36 @@ export const meta: MetaFunction = () => { ]; }; -export default function Index() { - const [inputValue, setInputValue] = useState("Hello"); - const [textareaValue, setTextareaValue] = useState("World"); +const dialogTriggerReactNode = Open; +export default function Index() { return ( - setInputValue(e.target.value)} - /> - setTextareaValue(e.target.value)} - /> Welcome to Chakra UI v3 + Remix + + + Dialog Title + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. + + + + + Cancel + + Save + + + + diff --git a/pkgs/frontend/package.json b/pkgs/frontend/package.json index b856e95..95ea5d5 100644 --- a/pkgs/frontend/package.json +++ b/pkgs/frontend/package.json @@ -23,7 +23,8 @@ "lucide-react": "^0.399.0", "next-themes": "^0.4.3", "react": "^18.3.1", - "react-dom": "^18.3.1" + "react-dom": "^18.3.1", + "react-icons": "^5.3.0" }, "devDependencies": { "@remix-run/dev": "^2.15.0",
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. +