-
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.
Browse files
Browse the repository at this point in the history
[Feat/#89] ๋ฐ๋ ค๋๋ฌผ ์ฑ๋ณ ๋ทฐ
- Loading branch information
Showing
3 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/page/onboarding/index/component/petGender/PetGender.css.ts
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 { style } from "@vanilla-extract/css"; | ||
|
||
export const layout = style({ | ||
display: "flex", | ||
flexDirection: "column", | ||
padding: "8rem 2rem", | ||
gap: "9rem", | ||
}); | ||
|
||
export const btnWrapper = style({ | ||
maxWidth: "76.8rem", | ||
width: "100%", | ||
position: "fixed", | ||
bottom: 0, | ||
|
||
display: "grid", | ||
gridTemplateColumns: "9.6rem calc(100% - 10.8rem)", | ||
gap: "1.2rem", | ||
whiteSpace: "nowrap", | ||
padding: "1.2rem 2rem 3.2rem 2rem", | ||
}); |
49 changes: 49 additions & 0 deletions
49
src/page/onboarding/index/component/petGender/PetGender.tsx
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,49 @@ | ||
import * as styles from "./PetGender.css"; | ||
import { useNavigate } from "react-router-dom"; | ||
import { ONBOARDING_GUIDE } from "@page/onboarding/index/constant/onboardingGuide"; | ||
import Title from "@page/onboarding/index/common/title/Title"; | ||
import Docs from "@page/onboarding/index/common/docs/Docs"; | ||
import DualOptionSelector from "../dualOptionSelector/DualOptionSelector"; | ||
import { Button } from "@common/component/Button"; | ||
import { data } from "@page/onboarding/index/constant/genderData"; | ||
import { useState } from "react"; | ||
|
||
const PetGender = () => { | ||
// ์ ํ ์ํ ๊ด๋ฆฌ (์ด๊ธฐ๊ฐ: null) | ||
const [gender, setGender] = useState<string | null>(null); | ||
|
||
// ์ ํํ ๋ฒํผ ํ ์คํธ = selectedPetType | ||
const handleOptionSelect = (value: string) => { | ||
setGender(value); | ||
}; | ||
// ๋ค๋ก ๊ฐ๊ธฐ | ||
const navigate = useNavigate(); | ||
const handleGoBack = () => { | ||
navigate(-1); | ||
}; | ||
|
||
// ๋ค์ ๋ฒํผ | ||
const handleNext = () => { | ||
console.log("๋ค์ pr์์ ๊ตฌํํ ๋์ฅ."); | ||
}; | ||
return ( | ||
<> | ||
{/* ์๋จ ์์ญ */} | ||
<div className={styles.layout}> | ||
<div> | ||
<Title text={ONBOARDING_GUIDE.petGender.title} /> | ||
<Docs text={ONBOARDING_GUIDE.petGender.docs} /> | ||
</div> | ||
{/* ์ฑ๋ณ ์ ํ ์์ญ */} | ||
<DualOptionSelector data={data.gender} onSelect={handleOptionSelect} /> | ||
</div> | ||
{/* ํ๋จ ์์ญ */} | ||
<div className={styles.btnWrapper}> | ||
<Button label="๋์๊ฐ๊ธฐ" size="large" variant="solidNeutral" disabled={false} onClick={handleGoBack} /> | ||
<Button label="๋ค์" size="large" variant="solidPrimary" disabled={!gender} onClick={handleNext} /> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default PetGender; |
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,17 @@ | ||
import selectImg from "@asset/image/image 1733.png"; | ||
|
||
// ์ฌ๊ธฐ๋ api ์ฐ๊ฒฐ ์๋๋, api์ฐ๊ฒฐ๋ทฐ์ ์ปดํฌ๋ํธ๋ฅผ ๊ณต์ ํด ๋ค์๊ณผ ๊ฐ์ด ๊ตฌํ | ||
export const data = { | ||
gender: [ | ||
{ | ||
id: 1, | ||
label: "์์ปท", | ||
image: selectImg, | ||
}, | ||
{ | ||
id: 2, | ||
label: "์์ปท", | ||
image: selectImg, | ||
}, | ||
], | ||
}; |