-
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.
* Feat:드랍관련 변경내용 적용 * Feat:link 추가 입력창 기능구현 * Feat:드랍다운 유효성 hook-form기능 추가 * Feat:링크 인풋 유효성 검사 기능 추가
- Loading branch information
Showing
7 changed files
with
255 additions
and
83 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
co-kkiri/src/components/commons/RecruitmentRequestLayout/LinkInput.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,39 @@ | ||
import styled from "styled-components"; | ||
import DESIGN_TOKEN from "@/styles/tokens"; | ||
import { DROPDOWN_INFO } from "@/constants/dropDown"; | ||
|
||
interface LinkInputProps { | ||
selectedOption: string; | ||
onChange: (value: string) => void; | ||
} | ||
|
||
export default function LinkInput({ selectedOption, onChange }: LinkInputProps) { | ||
const { recruitment } = DROPDOWN_INFO; | ||
const optionIndex = recruitment.contactWay.options?.indexOf(selectedOption); | ||
const value = recruitment.contactWay.placeholder[optionIndex]; | ||
|
||
return ( | ||
<Container> | ||
{selectedOption !== "기타" ? <Input placeholder={value} onChange={(e) => onChange(e.target.value)} /> : null} | ||
</Container> | ||
); | ||
} | ||
|
||
const { color } = DESIGN_TOKEN; | ||
|
||
const Container = styled.div` | ||
width: 100%; | ||
height: 4.8rem; | ||
`; | ||
|
||
const Input = styled.input` | ||
width: 100%; | ||
height: 4.8rem; | ||
border-radius: 0.5rem; | ||
border: 0.1rem solid ${color.gray[2]}; | ||
padding: 1.858rem; | ||
&:focus { | ||
outline: none; | ||
} | ||
`; |
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.