-
Notifications
You must be signed in to change notification settings - Fork 1
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] 대시보드 뷰 task 컴포넌트 퍼블리싱
- Loading branch information
Showing
4 changed files
with
138 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
import BtnTask from '@/components/common/BtnTask/BtnTask'; | ||
import ScrollGradient from '@/components/common/ScrollGradient'; | ||
import DASHBOARD_TASK_TYPE from '@/constants/dashboardTask'; | ||
import TODAY from '@/constants/tasksToday'; | ||
|
||
interface DashboardTaskProps { | ||
text: 'upcoming' | 'postponed' | 'inprogress'; | ||
} | ||
|
||
function DashboardTask({ text }: DashboardTaskProps) { | ||
let taskStatus = ''; | ||
if (text === 'upcoming') { | ||
taskStatus = DASHBOARD_TASK_TYPE.UPCOMING; | ||
} else if (text === 'postponed') { | ||
taskStatus = DASHBOARD_TASK_TYPE.POSTPONED; | ||
} else if (text === 'inprogress') { | ||
taskStatus = DASHBOARD_TASK_TYPE.INPROGRESS; | ||
} | ||
return ( | ||
<TaskLayout> | ||
<TextBox> | ||
<TaskText text={text}>{taskStatus}</TaskText> | ||
<NumberTextBox> | ||
<Number>{TODAY.data.tasks.length}</Number> | ||
<NumberText>개</NumberText> | ||
</NumberTextBox> | ||
</TextBox> | ||
<ScrollArea> | ||
<BtnTask btnType="target" status="Done" isDescription={false} /> | ||
<BtnTask btnType="target" status="Done" isDescription={false} /> | ||
<BtnTask btnType="target" status="Done" isDescription={false} /> | ||
<BtnTask btnType="target" status="Done" isDescription={false} /> | ||
<BtnTask btnType="target" status="Done" isDescription={false} /> | ||
<BtnTask btnType="target" status="Done" isDescription={false} /> | ||
<BtnTask btnType="target" status="Done" isDescription={false} /> | ||
<ScrollGradient /> | ||
</ScrollArea> | ||
</TaskLayout> | ||
); | ||
} | ||
export default DashboardTask; | ||
|
||
const TaskLayout = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
align-self: stretch; | ||
width: 41.7rem; | ||
height: 41rem; | ||
border: 1px solid ${({ theme }) => theme.palette.Grey.Grey3}; | ||
border-radius: 12px; | ||
`; | ||
|
||
const TextBox = styled.span` | ||
display: flex; | ||
justify-content: space-between; | ||
width: 41.7rem; | ||
height: 7rem; | ||
`; | ||
|
||
const TaskText = styled.div<{ text: string }>` | ||
display: flex; | ||
align-items: flex-start; | ||
min-width: 11.8rem; | ||
padding: 1.8rem 0 2rem 2.2rem; | ||
${({ theme }) => theme.fontTheme.HEADLINE_02}; | ||
color: ${({ theme }) => theme.palette.Grey.Black}; | ||
`; | ||
|
||
const NumberTextBox = styled.div` | ||
display: flex; | ||
align-items: center; | ||
width: 3.8rem; | ||
height: 4rem; | ||
margin: 1.5rem 2.2rem 1.5rem 0; | ||
`; | ||
|
||
const Number = styled.p` | ||
${({ theme }) => theme.fontTheme.TITLE_02}; | ||
color: ${({ theme }) => theme.palette.Grey.Grey8}; | ||
`; | ||
|
||
const NumberText = styled.p` | ||
${({ theme }) => theme.fontTheme.HEADLINE_02} | ||
color: ${({ theme }) => theme.palette.Grey.Grey7} | ||
`; | ||
|
||
const ScrollArea = styled.div` | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.8rem; | ||
align-items: stretch; | ||
box-sizing: border-box; | ||
width: 41.7rem; | ||
height: 33.9rem; | ||
padding: 0 0.7rem; | ||
overflow: scroll; | ||
`; |
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,7 @@ | ||
const DASHBOARD_TASK_TYPE = { | ||
UPCOMING: '다가오는 할 일', | ||
POSTPONED: '지연된 할 일', | ||
INPROGRESS: '진행중인 할 일', | ||
}; | ||
|
||
export default DASHBOARD_TASK_TYPE; |
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,26 @@ | ||
const TODAY = { | ||
code: 'success', | ||
data: { | ||
tasks: [ | ||
{ | ||
id: 1, | ||
name: 'task name', | ||
deadLine: { | ||
date: '2024-06-30', | ||
time: '12:30', | ||
}, | ||
}, | ||
{ | ||
id: 2, | ||
name: 'task name', | ||
deadLine: { | ||
date: '2024-06-30', | ||
time: '12:30', | ||
}, | ||
}, | ||
], | ||
}, | ||
message: null, | ||
}; | ||
|
||
export default TODAY; |
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