Skip to content

Commit

Permalink
fix: app statistic box (#776)
Browse files Browse the repository at this point in the history
  • Loading branch information
leduyhien152 authored Feb 22, 2024
1 parent 92fae44 commit 836acdf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions apps/mochi-web/components/app/Statistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const Statistics = ({ id, onOpenCreateAppModal }: Props) => {
amount={stats?.users_in_7d}
change={stats?.users_in_7d_change_percentage_vs_last_period}
className="sm:order-4"
milestone="week"
milestone="period"
/>
<StatisticsBox
label="All time Revenue"
Expand All @@ -57,7 +57,7 @@ export const Statistics = ({ id, onOpenCreateAppModal }: Props) => {
formatAmount={(amount) => `$${formatNumber(amount)}`}
change={stats?.revenue_in_7d_change_percentage_vs_last_period}
className="sm:order-5"
milestone="week"
milestone="period"
/>
<StatisticsBox
label="All time Txs"
Expand All @@ -69,7 +69,7 @@ export const Statistics = ({ id, onOpenCreateAppModal }: Props) => {
amount={stats?.txs_in_7d}
change={stats?.txs_in_7d_change_percentage_vs_last_period}
className="sm:order-6"
milestone="week"
milestone="period"
/>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions apps/mochi-web/components/app/StatisticsBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface Props {
formatAmount?: (amount: number) => string
change?: number
formatChange?: (change: number) => string
milestone?: 'week' | 'month'
milestone?: 'period' | 'month'
size?: 'md' | 'lg'
footer?: React.ReactNode
className?: string
Expand Down Expand Up @@ -49,14 +49,14 @@ export const StatisticsBox = ({
<ArrowUpLine
className={clsx(
'w-4 h-4',
change > 0
change >= 0
? 'text-success-plain-fg'
: 'text-danger-plain-fg rotate-180',
)}
/>
<Typography
level="p5"
color={change > 0 ? 'success' : 'danger'}
color={change >= 0 ? 'success' : 'danger'}
className="font-medium"
>
{formatChange(change)}
Expand Down
8 changes: 4 additions & 4 deletions apps/mochi-web/components/app/detail/AppDetailStatistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export const AppDetailStatistics = ({
formatAmount={(amount) => `$${formatNumber(amount)}`}
change={stats?.balance_in_total_change_vs_last_week || 0}
formatChange={(change) => `$${formatNumber(change)}`}
milestone="week"
// milestone="period"
footer={
<div className="flex gap-2 mt-4">
<Button size="sm">
Expand All @@ -219,7 +219,7 @@ export const AppDetailStatistics = ({
amount={stats?.users_in_7d}
change={stats?.users_in_7d_change_percentage_vs_last_period}
className="border border-divider shadow-input sm:order-4"
milestone="week"
milestone="period"
/>
<StatisticsBox
label="All time Revenue"
Expand All @@ -233,7 +233,7 @@ export const AppDetailStatistics = ({
formatAmount={(amount) => `$${formatNumber(amount)}`}
change={stats?.revenue_in_7d_change_percentage_vs_last_period}
className="border border-divider shadow-input sm:order-5"
milestone="week"
milestone="period"
/>
<StatisticsBox
label="All time Txs"
Expand All @@ -245,7 +245,7 @@ export const AppDetailStatistics = ({
amount={stats?.txs_in_7d}
change={stats?.txs_in_7d_change_percentage_vs_last_period}
className="border border-divider shadow-input sm:order-6"
milestone="week"
milestone="period"
/>
</div>
</div>
Expand Down

0 comments on commit 836acdf

Please sign in to comment.