-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 기초 구조 잡기 * fix: command button secondary 스타일 추가 * docs: svg 파일 추가 * refactor: commandButton style 추가 * feat: timeblock 업로드된 파일 item 구현 * feat: TimeBlock 업로드된 파일 컴포넌트 구현 * feat: TimeBlock 태그된 인수인계 노트 item 구현 * feat: TimeBlock 태그된 인수인계 노트 컴포넌트 구현 * feat: TimeBlock info 구현 * feat: TimeBlockBar 컴포넌트 구현 * feat: TimeBlockDrawer 컴포넌트 구현 * feat: TimeBlockBar close 버튼 기능 구현 * feat: 수정하기 뷰 구현 * fix: textOverflow 에러 해결 * fix: button 공컴 disabled 시 cursor 이벤트 없애기 * style: cursor pointer * refactor: 잔잔바리 수정 * fix: 버튼 공컴 정상화 * fix: 코드리뷰 반영
- Loading branch information
Showing
26 changed files
with
417 additions
and
25 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
11 changes: 11 additions & 0 deletions
11
src/page/archiving/index/component/TimeBlockBar/BlockInfo/BlockInfo.style.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,11 @@ | ||
import { css } from '@emotion/react'; | ||
|
||
import { theme } from '@/common/style/theme/theme'; | ||
|
||
export const periodStyle = css({ | ||
color: theme.colors.gray_800, | ||
}); | ||
|
||
export const titleInputStyle = css({ | ||
width: '21.4rem', | ||
}); |
33 changes: 33 additions & 0 deletions
33
src/page/archiving/index/component/TimeBlockBar/BlockInfo/BlockInfo.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,33 @@ | ||
import DatePicker from '@/common/component/DatePicker'; | ||
import Flex from '@/common/component/Flex/Flex'; | ||
import Heading from '@/common/component/Heading/Heading'; | ||
import Input from '@/common/component/Input/Input'; | ||
import Text from '@/common/component/Text/Text'; | ||
|
||
import { periodStyle, titleInputStyle } from '@/page/archiving/index/component/TimeBlockBar/BlockInfo/BlockInfo.style'; | ||
import { formattingDate } from '@/page/archiving/index/util/date'; | ||
|
||
interface BlockInfoProps { | ||
title: string; | ||
startDate: Date; | ||
endDate: Date; | ||
isEditable: boolean; | ||
} | ||
|
||
const BlockInfo = ({ title, startDate, endDate, isEditable }: BlockInfoProps) => { | ||
return ( | ||
<Flex styles={{ direction: 'column', gap: '1rem', marginTop: '1.8rem', width: '100%' }}> | ||
{isEditable ? <Input css={titleInputStyle} value={title} /> : <Heading tag="H6">{title}</Heading>} | ||
|
||
{isEditable ? ( | ||
<DatePicker variant="range" triggerWidth="100%" /> | ||
) : ( | ||
<Text tag="body6" css={periodStyle}> | ||
{formattingDate(startDate)} ~ {formattingDate(endDate)} | ||
</Text> | ||
)} | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default BlockInfo; |
11 changes: 11 additions & 0 deletions
11
...archiving/index/component/TimeBlockBar/TaggedNotes/TaggedNoteItem/TaggedNoteItem.style.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,11 @@ | ||
import { css } from '@emotion/react'; | ||
|
||
export const handoverNoteItemStyle = css({ | ||
display: 'block', | ||
|
||
maxWidth: '20.6rem', | ||
|
||
whiteSpace: 'nowrap', | ||
overflow: 'hidden', | ||
textOverflow: 'ellipsis', | ||
}); |
23 changes: 23 additions & 0 deletions
23
...page/archiving/index/component/TimeBlockBar/TaggedNotes/TaggedNoteItem/TaggedNoteItem.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,23 @@ | ||
import IcArrowRight from '@/common/asset/svg/ic_subdirectory_arrow_right.svg?react'; | ||
import Button from '@/common/component/Button/Button'; | ||
import Flex from '@/common/component/Flex/Flex'; | ||
|
||
import { handoverNoteItemStyle } from '@/page/archiving/index/component/TimeBlockBar/TaggedNotes/TaggedNoteItem/TaggedNoteItem.style'; | ||
|
||
interface TaggedNoteItemProps { | ||
title: string; | ||
isEditable: boolean; | ||
} | ||
|
||
const TaggedNoteItem = ({ title, isEditable }: TaggedNoteItemProps) => { | ||
return ( | ||
<Flex tag="li" styles={{ gap: '0.8rem', width: '100%' }} style={{ overflow: 'hidden' }}> | ||
<IcArrowRight width={16} height={16} /> | ||
<Button disabled={isEditable} variant="outline" size="xSmall" css={handoverNoteItemStyle}> | ||
{title} | ||
</Button> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default TaggedNoteItem; |
37 changes: 37 additions & 0 deletions
37
src/page/archiving/index/component/TimeBlockBar/TaggedNotes/TaggedNotes.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,37 @@ | ||
import IcNote from '@/common/asset/svg/ic_note_black.svg?react'; | ||
import Flex from '@/common/component/Flex/Flex'; | ||
import Text from '@/common/component/Text/Text'; | ||
|
||
import TaggedNoteItem from '@/page/archiving/index/component/TimeBlockBar/TaggedNotes/TaggedNoteItem/TaggedNoteItem'; | ||
import { listHeaderStyle } from '@/page/archiving/index/component/TimeBlockBar/TimeBlockBar.style'; | ||
|
||
interface TaggedNotesProps { | ||
isEditable: boolean; | ||
} | ||
|
||
// TODO: API 추가 | ||
const HANDOVER_NOTE_LIST = [ | ||
{ id: 1, title: '세상에서 제일 긴 제목을 지을거에요 나는 하하하하하하하ㅏ핳하' }, | ||
{ id: 2, title: 'OT 인수인계' }, | ||
{ id: 3, title: '엄마 나는 토스에 가고 싶어요' }, | ||
]; | ||
|
||
const TaggedNotes = ({ isEditable }: TaggedNotesProps) => { | ||
return ( | ||
<Flex styles={{ direction: 'column', gap: '1.8rem' }}> | ||
<Flex styles={{ gap: '0.8rem', align: 'center' }}> | ||
<IcNote width={16} height={16} /> | ||
<Text tag="body6" css={listHeaderStyle}> | ||
태그된 인수인계 노트 | ||
</Text> | ||
</Flex> | ||
<Flex tag="ul" styles={{ direction: 'column', gap: '0.8rem' }}> | ||
{HANDOVER_NOTE_LIST.map((data) => ( | ||
<TaggedNoteItem key={data.id} title={data.title} isEditable={isEditable} /> | ||
))} | ||
</Flex> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default TaggedNotes; |
27 changes: 27 additions & 0 deletions
27
src/page/archiving/index/component/TimeBlockBar/TimeBlockBar.style.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,27 @@ | ||
import { css } from '@emotion/react'; | ||
|
||
import { theme } from '@/common/style/theme/theme'; | ||
|
||
export const closeBtnStyle = css({ | ||
position: 'absolute', | ||
|
||
right: '2.2rem', | ||
top: '3.2rem', | ||
|
||
cursor: 'pointer', | ||
}); | ||
|
||
export const circleStyle = (color: string) => | ||
css({ | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
|
||
padding: '0.6rem', | ||
|
||
borderRadius: '18px', | ||
backgroundColor: color, | ||
}); | ||
|
||
export const listHeaderStyle = css({ | ||
color: theme.colors.gray_800, | ||
}); |
56 changes: 56 additions & 0 deletions
56
src/page/archiving/index/component/TimeBlockBar/TimeBlockBar.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,56 @@ | ||
import { useState } from 'react'; | ||
|
||
import CloseButton from '@/common/asset/svg/ic_close.svg?react'; | ||
import CommandButton from '@/common/component/CommandButton/CommandButton'; | ||
import Flex from '@/common/component/Flex/Flex'; | ||
|
||
import BlockInfo from '@/page/archiving/index/component/TimeBlockBar/BlockInfo/BlockInfo'; | ||
import TaggedNotes from '@/page/archiving/index/component/TimeBlockBar/TaggedNotes/TaggedNotes'; | ||
import { circleStyle, closeBtnStyle } from '@/page/archiving/index/component/TimeBlockBar/TimeBlockBar.style'; | ||
import UploadedFiles from '@/page/archiving/index/component/TimeBlockBar/UploadedFiles/UploadedFiles'; | ||
import { BLOCK_ICON } from '@/page/archiving/index/constant/icon'; | ||
|
||
import { DrawerContent } from '@/shared/store/drawer'; | ||
|
||
interface TimeBlockBarProps { | ||
content: DrawerContent; | ||
onCloseDrawer: () => void; | ||
} | ||
|
||
const TimeBlockBar = ({ content, onCloseDrawer }: TimeBlockBarProps) => { | ||
const [isEditable, setIsEditable] = useState(false); | ||
|
||
const handleEditClick = () => { | ||
setIsEditable((prevState) => !prevState); | ||
}; | ||
|
||
return ( | ||
content && ( | ||
<section> | ||
<CloseButton width={16} height={16} css={closeBtnStyle} onClick={onCloseDrawer} /> | ||
|
||
<Flex styles={{ justify: 'space-between', marginTop: '7.4rem' }}> | ||
<Flex css={circleStyle(content.color)}> | ||
{BLOCK_ICON.find((icon) => icon.name === content.blockType)?.icon(content.color)} | ||
</Flex> | ||
<CommandButton variant="fourth" commandKey={isEditable ? 'S' : 'E'} size="xSmall" onClick={handleEditClick}> | ||
{isEditable ? '저장' : '수정하기'} | ||
</CommandButton> | ||
</Flex> | ||
|
||
<Flex styles={{ direction: 'column', gap: '3.6rem' }}> | ||
<BlockInfo | ||
title={content.title} | ||
startDate={content.startDate} | ||
endDate={content.endDate} | ||
isEditable={isEditable} | ||
/> | ||
<TaggedNotes isEditable={isEditable} /> | ||
<UploadedFiles isEditable={isEditable} /> | ||
</Flex> | ||
</section> | ||
) | ||
); | ||
}; | ||
|
||
export default TimeBlockBar; |
47 changes: 47 additions & 0 deletions
47
src/page/archiving/index/component/TimeBlockBar/UploadedFiles/FileItem/FileItem.style.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,47 @@ | ||
import { css } from '@emotion/react'; | ||
|
||
import { theme } from '@/common/style/theme/theme'; | ||
|
||
export const containerStyle = css({ | ||
gap: '1.2rem', | ||
alignItems: 'center', | ||
justifyContent: 'space-between', | ||
|
||
width: '100%', | ||
padding: '0.6rem', | ||
|
||
backgroundColor: theme.colors.gray_100, | ||
borderRadius: '8px', | ||
|
||
cursor: 'pointer', | ||
|
||
'&:hover': { | ||
backgroundColor: theme.colors.gray_200, | ||
}, | ||
}); | ||
|
||
export const circleStyle = css({ | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
|
||
padding: '0.8rem', | ||
|
||
backgroundColor: theme.colors.white, | ||
borderRadius: '16px', | ||
}); | ||
|
||
export const fileTitleStyle = css({ | ||
maxWidth: '15rem', | ||
|
||
whiteSpace: 'nowrap', | ||
overflow: 'hidden', | ||
textOverflow: 'ellipsis', | ||
}); | ||
|
||
export const fileCapacityStyle = css({ | ||
color: theme.colors.gray_800, | ||
}); | ||
|
||
export const closeBtnStyle = css({ | ||
cursor: 'pointer', | ||
}); |
Oops, something went wrong.