Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export interface Goal {
accountId: string
transactionIds: string[]
tagIds: string[]


icon?: string
}

export interface Tag {
Expand Down
21 changes: 14 additions & 7 deletions src/ui/pages/Main/goals/GoalCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ export default function GoalCard(props: Props) {

const asLocaleDateString = (date: Date) => new Date(date).toLocaleDateString()

return (
<Container key={goal.id} onClick={onClick}>
<TargetAmount>${goal.targetAmount}</TargetAmount>
<TargetDate>{asLocaleDateString(goal.targetDate)}</TargetDate>
</Container>
)
return (
<Container key={goal.id} onClick={onClick}>
<Icon>{goal.icon || "🎯"}</Icon>

<TargetAmount>${goal.targetAmount}</TargetAmount>

<TargetDate>{asLocaleDateString(goal.targetDate)}</TargetDate>
</Container>
)
}

const Container = styled(Card)`
Expand All @@ -46,10 +49,14 @@ const Container = styled(Card)`

align-items: center;
`
const Icon = styled.div`
font-size: 3rem;
margin-bottom: 1rem;
`

const TargetAmount = styled.h2`
font-size: 2rem;
`

const TargetDate = styled.h4`
color: rgba(174, 174, 174, 1);
font-size: 1rem;
Expand Down