Skip to content
Draft
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
16 changes: 16 additions & 0 deletions src/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ export enum BadgeVariant {
SUCCESS = 'success',
WARNING = 'warning',
ERROR = 'error',
LIGHT = 'light',
}

export enum BadgeRoundings {
SMALL = 'small',
MEDIUM = 'medium',
}

export interface BadgeProps {
Expand All @@ -24,6 +30,9 @@ export interface BadgeProps {
size?: BadgeSize
variant?: BadgeVariant
hoverable?: boolean
className?: string
wide?: boolean
roundings?: BadgeRoundings
}

export const Badge = ({
Expand All @@ -34,6 +43,9 @@ export const Badge = ({
size = BadgeSize.MEDIUM,
variant = BadgeVariant.DEFAULT,
hoverable = false,
className,
wide,
roundings = BadgeRoundings.SMALL,
}: BadgeProps) => {
const baseProps = {
className: classNames(
Expand All @@ -42,6 +54,10 @@ export const Badge = ({
onClick || tooltip ? 'Layer__badge--clickable' : '',
`Layer__badge--${size}`,
`Layer__badge--${variant}`,
roundings !== BadgeRoundings.MEDIUM &&
`Layer__badge--roundings-${roundings}`,
wide && 'Layer__badge--wide',
className,
),
onClick,
children,
Expand Down
19 changes: 13 additions & 6 deletions src/components/NotificationCard/NotificationCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,29 @@ import classNames from 'classnames'
export interface NotificationCardProps {
onClick: () => void
children: ReactNode
bottomBar?: ReactNode
className?: string
}

export const NotificationCard = ({
onClick,
children,
bottomBar,
className,
}: NotificationCardProps) => {
return (
<div className={classNames('Layer__notification-card', className)}>
<div className='Layer__notification-card__main'>{children}</div>
<IconButton
icon={<ChevronRightIcon />}
withBorder
onClick={() => onClick()}
/>
<div className='Layer__notification-card__content'>
<div className='Layer__notification-card__main'>{children}</div>
<IconButton
icon={<ChevronRightIcon />}
withBorder
onClick={() => onClick()}
/>
</div>
{bottomBar && (
<div className='Layer__notification-card__bottom-bar'>{bottomBar}</div>
)}
</div>
)
}
21 changes: 21 additions & 0 deletions src/components/ProfitAndLossChart/ProfitAndLossChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ export const ProfitAndLossChart = ({
netProfit > 0 ? 'positive' : netProfit < 0 ? 'negative' : ''
const revenue = payload.find(x => x.dataKey === 'revenue')?.value ?? 0
const expenses = payload.find(x => x.dataKey === 'expenses')?.value ?? 0
const revenueUncategorized =
payload.find(x => x.dataKey === 'revenueUncategorized')?.value ?? 0
const expensesUncategorized =
payload.find(x => x.dataKey === 'expensesUncategorized')?.value ?? 0

return (
<div className='Layer__chart__tooltip'>
Expand All @@ -393,12 +397,29 @@ export const ProfitAndLossChart = ({
${centsToDollars(revenue)}
</span>
</li>
<li className='Layer__chart__tooltip-list--secondary-item'>
<label className='Layer__chart__tooltip-label'>
Uncategorized
</label>
<span className='Layer__chart__tooltip-value'>
${centsToDollars(revenueUncategorized)}
</span>
</li>
<li>
<label className='Layer__chart__tooltip-label'>Expenses</label>
<span className='Layer__chart__tooltip-value'>
${centsToDollars(Math.abs(expenses))}
</span>
</li>
<li className='Layer__chart__tooltip-list--secondary-item'>
<label className='Layer__chart__tooltip-label'>
Uncategorized
</label>
<span className='Layer__chart__tooltip-value'>
{expensesUncategorized &&
`$${centsToDollars(expensesUncategorized * -1)}`}
</span>
</li>
<li>
<label className='Layer__chart__tooltip-label'>
Net Profit
Expand Down
Loading