-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #179 from hackdays-io/feature/dialog-chakra
ChakraUI V3によるCommonDialogコンポーネント
- Loading branch information
Showing
7 changed files
with
74 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<DialogRoot> | ||
<DialogTrigger asChild>{dialogTriggerReactNode}</DialogTrigger> | ||
<DialogContent>{children}</DialogContent> | ||
</DialogRoot> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Input, InputProps } from "@chakra-ui/react"; | ||
|
||
interface CommonInputProps extends Omit<InputProps, "value"> { | ||
value: string | number; | ||
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void; | ||
} | ||
|
||
export const CommonInput = ({ value, onChange }: CommonInputProps) => { | ||
return <Input value={value} onChange={onChange} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Textarea, TextareaProps } from "@chakra-ui/react"; | ||
|
||
interface CommonTextAreaProps extends Omit<TextareaProps, "value"> { | ||
value: string; | ||
onChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void; | ||
} | ||
|
||
export const CommonTextArea = ({ value, onChange }: CommonTextAreaProps) => { | ||
return <Textarea value={value} onChange={onChange} />; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters