Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #131 from mgilangjanuar/staging
Browse files Browse the repository at this point in the history
hotfix: get user plan from navbar
  • Loading branch information
mgilangjanuar authored Dec 5, 2021
2 parents f01964d + 87fd111 commit 28ec86e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/pages/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Navbar: React.FC<Props> = ({ user, page }) => {
<Popover placement="bottomRight" trigger={['click']} content={<div>
<div style={{ padding: '10px' }}>
Bandwidth usage: { }
{user?.plan === 'premium' ? <Tag color="green">Unlimited</Tag> : <Tooltip placement="left" title={<>You can download up to {prettyBytes(Math.max(0, 1_500_000_000 - Number(usage?.usage.usage)))} until {moment(usage?.usage.expire).local().format('lll')}</>}>
{(user?.user?.plan || user?.plan) === 'premium' ? <Tag color="green">Unlimited</Tag> : <Tooltip placement="left" title={<>You can download up to {prettyBytes(Math.max(0, 1_500_000_000 - Number(usage?.usage.usage)))} until {moment(usage?.usage.expire).local().format('lll')}</>}>
<Progress status="exception" percent={Number((usage?.usage.usage / 1_500_000_000 * 100).toFixed(1))} />
</Tooltip>}
</div>
Expand Down

0 comments on commit 28ec86e

Please sign in to comment.