Skip to content

Commit

Permalink
design: 링크가 하나 첨부된 경우 추가 입력란과 버튼 비활성화 (#363)
Browse files Browse the repository at this point in the history
- 링크 첨부 유무에 따라 disable 설정
- disable 유무에 따라 input의 placeholder 문구 변경

#361
  • Loading branch information
yeonddori authored Dec 5, 2024
1 parent a0710a2 commit 4f73200
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/containers/study/CreateDocumentModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,20 @@ const CreateDocumentModal = ({ isOpen, onClose, categoryData, category }: Docume
flex="1"
h="7"
shadow="md"
_disabled={{ cursor: 'not-allowed', bg: 'orange_light', _hover: { bg: 'orange_light' } }}
hidden={doctype !== 'URL'}
placeholder="URL 링크를 입력해주세요."
isDisabled={docList.URL.length > 0}
placeholder={docList.URL.length > 0 ? '링크는 1개만 첨부 가능합니다.' : 'URL 링크를 입력해주세요.'}
/>
<Button w="28" h="7" shadow="md" onClick={() => handleAddDoc[doctype]()} variant="orange">
<Button
w="28"
h="7"
shadow="md"
_disabled={{ cursor: 'not-allowed', bg: 'orange_light', _hover: { bg: 'orange_light' } }}
isDisabled={doctype === 'URL' && docList.URL.length > 0}
onClick={category === 'create' ? () => handleAddDoc[doctype]() : () => {}}
variant="orange"
>
추가하기
</Button>
</Flex>
Expand Down

0 comments on commit 4f73200

Please sign in to comment.