Common Components Input - kookmin-sw/capstone-2025-44 GitHub Wiki
μ΄ λ¬Έμλ νμνμ΄μμ μ¬μ©λλ μ λ ₯(Input) μ»΄ν¬λνΈμ λν΄ μ€λͺ ν©λλ€. μ΄ μ»΄ν¬λνΈλ€μ μ¬μ©μ μ λ ₯μ λ°λ μΌκ΄λ UI μμλ‘, μ ν¨μ± κ²μ¬, μ€νμΌλ§, μλ¬ νΌλλ°±μ ν¬ν¨νμ¬ λ€μν μ λ ₯ μλ리μ€λ₯Ό μ²λ¦¬ν©λλ€.
src/assets/icons/edit.svg
src/assets/icons/female.svg
src/assets/icons/male.svg
src/assets/icons/modal-back.svg
src/assets/icons/modal-close.svg
src/components/common/Input-box.tsx
src/components/common/common-input.tsx
src/components/common/camera/camera.tsx
src/components/common/camera/camera.css
src/components/common/profile-modal.tsx
src/components/common/type.ts
src/components/mypage/profile-edit/input-wrapper.tsx
src/components/mypage/profile-edit/location-swiper.css
src/components/mypage/profile-edit/profile-edit-modal.tsx
src/components/mypage/profile-edit/retake-photo.tsx
src/components/posting/posting-bold-text.tsx
src/hooks/queries/useEditProfile.ts
-
κ³΅ν΅ μ λ ₯ μ»΄ν¬λνΈ (Common)
CommonInput
InputBox
-
νλ‘ν νΈμ§μ© μ λ ₯ μ»΄ν¬λνΈ
-
InputInner
(μ«μν) -
InputNum
(μ«μν) -
InputMap
(κ²μν) NicknameInput
GenderInput
InputWrapper
LocationSwiper
-
κ³΅ν΅ μ λ ₯ νμ (InputType)
interface InputType {
value: string | number;
setValue: React.Dispatch<...>;
children?: React.ReactNode;
isError?: boolean;
setIsError?: React.Dispatch<...>;
}
InputInnerPropsλ μ΅λκ°, μ΅μκ°, κ°κ²© μ¬λΆ λ±μ μ ν¨μ± μ μ½ μ‘°κ±΄μ μΆκ°λ‘ ν¬ν¨ν©λλ€.
- μ λ ₯ νλλ₯Ό κ°μΈλ 컨ν μ΄λ μν
- λ΄λΆμ
InputNum
,InputMap
λ± νΉν μ»΄ν¬λνΈλ₯Ό ν¬ν¨
π Input-box.tsx
- μ«μλ§ μ λ ₯ κ°λ₯ (μ: κ°κ²©, μλ)
- κ°μ‘°λ λ°°κ²½μκ³Ό λ¨μ(μ: μ) νμ
- κ²μμ© μΈν (μ: μμΉ κ²μ)
- μλͺ»λ μ λ ₯ μ μκ°μ νΌλλ°±(νλ€λ¦Ό, λ°°κ²½μ λ³ν)
- κ³΅ν΅ μ€νμΌμ μ μ©ν μ λ ₯ λνΌ
- λ΄λΆμ
InputInner
ν¬ν¨ - μ ν¨μ± κ²μ¬: μ΅λ/μ΅μκ°, 곡λ λ±
- μλ¬ μν μ μ λλ©μ΄μ + 5μ΄ ν μλ 리μ
π common-input.tsx
- λͺ¨λ νλ‘ν μ λ ₯ UIλ₯Ό κ°μΈλ 컨ν μ΄λ
- μ€λ μ§μ ν λ리, μμ μμ΄μ½ ν¬ν¨
π input-wrapper.tsx
-
NicknameInput: μ΅λ 5μ,
onBlur
μ μν κ°±μ - GenderInput: λ¨/μ¬ μ ν, μ¬λΌμ΄λ μ λλ©μ΄μ μ μ©
- LocationSwiper: μμΉ μ νμ© μΊλ¬μ , Swiper μ¬μ©
- ProfileImage: ν΄λ¦ μ μΉ΄λ©λΌ μΈν°νμ΄μ€ μ€ν (μ¬μ§ 촬μ)
μ λ ₯ μ»΄ν¬λνΈλ€μ λ€μκ³Ό κ°μ ν¨ν΄μ ν΅ν΄ μ ν¨μ± κ²μ¬λ₯Ό μνν©λλ€:
- μ¬μ©μμ μ λ ₯ λ°μ
- μ ν¨μ± κ²μ¬ μ€ν
- μ€ν¨ μ
isError
μν true μ€μ - μλ¬ νΌλλ°±: μ λλ©μ΄μ (νλ€λ¦Ό), μμ λ³ν
- 5μ΄ ν μλ¬ μν μ΄κΈ°ν
κ²μ¬ νλͺ©:
- μ΅λ/μ΅μκ°
- 곡백/λΉμ΄μλ κ°
- λλ€μ, μ±λ³, λμ΄, μ§μ, μ¬μ§ λ± μμ μ μ λ ₯ μ»΄ν¬λνΈ μ¬μ©
-
InputMap
μ μ¬μ©ν΄ μμΉ κ²μ κΈ°λ₯ ꡬν
π Input-box.tsx
- κ°κ²©, μκ°, μλ λ± μ
λ ₯ μ
InputNum
λλInputInner
μ¬μ©
π common-input.tsx
- λλΆλΆμ μ λ ₯ μ»΄ν¬λνΈλ λΆλͺ¨ μ»΄ν¬λνΈμμ μνλ₯Ό κ΄λ¦¬
- μλ¬ μν λν ν¨κ» κ΄λ¦¬νλ©° νμ΄λ¨Έλ‘ 리μ
- μ€νμΌλ§μ
styled-components
κΈ°λ°, ν λ§ μμ μΌκ΄μ± μ μ§ - μ λλ©μ΄μ μ CSS μ ν λλ Framer Motion μ¬μ©
- μΉ΄λ©λΌ 촬μ κΈ°λ₯μ
react-html5-camera-photo
λΌμ΄λΈλ¬λ¦¬ νμ©
Input μ»΄ν¬λνΈλ λ€μκ³Ό κ°μ νΉμ§μ κ°μ§λλ€:
- μ¬μ¬μ© κ°λ₯ν ꡬ쑰μ μΌκ΄λ μ€νμΌ μ 곡
- μ«μ, κ²μ, ν μ€νΈ λ± λ€μν μ λ ₯ λ°©μ λμ
- μλ¬μ λν μκ°μ νΌλλ°± μ 곡
- νλ‘ν μμ , κ²μ, μμΉ μ λ ₯ λ± λ€μν κΈ°λ₯μ μ μ©λ¨