-
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.
- Loading branch information
Showing
7 changed files
with
264 additions
and
85 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,18 @@ | ||
import { Box } from "@chakra-ui/react"; | ||
|
||
export const ContentContainer = ({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) => { | ||
return ( | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
justifyContent="center" | ||
alignItems="center" | ||
> | ||
{children} | ||
</Box> | ||
); | ||
}; |
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,21 @@ | ||
import { Box } from "@chakra-ui/react"; | ||
import { CommonTextArea } from "./common/CommonTextarea"; | ||
|
||
export const InputDescription = ({ | ||
description, | ||
setDescription, | ||
}: { | ||
description: string; | ||
setDescription: (description: string) => void; | ||
}) => { | ||
return ( | ||
<Box minH="100px" w="100%" mt={6}> | ||
<CommonTextArea | ||
minHeight="125px" | ||
placeholder="Description" | ||
value={description} | ||
onChange={(e) => setDescription(e.target.value)} | ||
/> | ||
</Box> | ||
); | ||
}; |
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,63 @@ | ||
import { Box, Input, Text } from "@chakra-ui/react"; | ||
import { CommonIcon } from "./common/CommonIcon"; | ||
import { HiOutlinePlus } from "react-icons/hi2"; | ||
|
||
const EmptyImage = () => { | ||
return ( | ||
<Box | ||
borderRadius="3xl" | ||
border="1px solid" | ||
borderColor="#1e1e1e" | ||
bg="#e9ecef" | ||
p={5} | ||
w={200} | ||
h={200} | ||
> | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
justifyContent="center" | ||
alignItems="center" | ||
w="33%" | ||
mx="auto" | ||
mt={9} | ||
mb={1} | ||
> | ||
<HiOutlinePlus size="full" /> | ||
</Box> | ||
<Text textAlign="center">画像を選択</Text> | ||
</Box> | ||
); | ||
}; | ||
|
||
export const InputImage = ({ | ||
imageFile, | ||
setImageFile, | ||
}: { | ||
imageFile: File | null; | ||
setImageFile: (file: File | null) => void; | ||
}) => { | ||
return ( | ||
<Box as="label" cursor="pointer" m="100px auto 40px"> | ||
<Input | ||
type="file" | ||
accept="image/*" | ||
display="none" | ||
onChange={(e) => { | ||
const file = e.target.files?.[0]; | ||
if (file && file.type.startsWith("image/")) { | ||
setImageFile(file); | ||
} else { | ||
alert("画像ファイルを選択してください"); | ||
} | ||
}} | ||
/> | ||
<CommonIcon | ||
imageUrl={imageFile ? URL.createObjectURL(imageFile) : undefined} | ||
fallbackIconComponent={<EmptyImage />} | ||
size={200} | ||
borderRadius="3xl" | ||
/> | ||
</Box> | ||
); | ||
}; |
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,21 @@ | ||
import { Box } from "@chakra-ui/react"; | ||
import { CommonInput } from "./common/CommonInput"; | ||
|
||
export const InputName = ({ | ||
name, | ||
setName, | ||
}: { | ||
name: string; | ||
setName: (name: string) => void; | ||
}) => { | ||
return ( | ||
<Box w="100%" mt={8}> | ||
<CommonInput | ||
minHeight="45px" | ||
placeholder="Name" | ||
value={name} | ||
onChange={(e) => setName(e.target.value)} | ||
/> | ||
</Box> | ||
); | ||
}; |
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
Oops, something went wrong.