Skip to content

Commit

Permalink
fix(dcellar-web-ui): current month card display error (#348)
Browse files Browse the repository at this point in the history
* fix(dcellar-web-ui): current month card display error

* fix(dcellar-web-ui): the price of QuotaItem
  • Loading branch information
devinxl authored Mar 4, 2024
1 parent d6debcf commit fdb1146
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
1 change: 0 additions & 1 deletion apps/dcellar-web-ui/src/components/formitems/QuotaItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export const QuotaItem = memo<QuotaItemProps>(function QuotaItem({

const price = useMemo(() => {
return BN(readPrice)
.div(10 ** 18)
.times(G_BYTES)
.times(2_592_000)
.div(10 ** 18)
Expand Down
23 changes: 16 additions & 7 deletions apps/dcellar-web-ui/src/modules/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ import { setupAllCostTrend, setupTotalCost } from '@/store/slices/billing';
import { useMount } from 'ahooks';
import { setupBuckets } from '@/store/slices/bucket';
import { setupBucketDailyStorage } from '@/store/slices/dashboard';
import Link from 'next/link';
import { getCurMonthDetailUrl } from '@/utils/accounts';
import { useRouter } from 'next/router';

export const Dashboard = () => {
const dispatch = useAppDispatch();
const { loginAccount } = useAppSelector((root) => root.persist);
const [isLessThan1200] = useMediaQuery('(max-width: 1200px)');
const curMonthDetailUrl = getCurMonthDetailUrl();
const router = useRouter();
const onNavigate = (path: string) => {
router.push(path);
};
useMount(async () => {
dispatch(setupOwnerAccount());
dispatch(setupTotalCost());
Expand All @@ -36,12 +40,17 @@ export const Dashboard = () => {
<Flex gap={16}>
<Flex flexDirection={'column'} gap={16} flex={1} minW={0}>
<Flex gap={16}>
<Link href={curMonthDetailUrl}>
<CurMonthCost flex={1} showLink={false} />
</Link>
<Link href={curMonthDetailUrl}>
<CurForecastCost flex={1} />
</Link>
<CurMonthCost
flex={1}
showLink={false}
onClick={() => onNavigate(curMonthDetailUrl)}
cursor={'pointer'}
/>
<CurForecastCost
flex={1}
onClick={() => onNavigate(curMonthDetailUrl)}
cursor={'pointer'}
/>
</Flex>
{isLessThan1200 && (
<Flex gap={16}>
Expand Down

0 comments on commit fdb1146

Please sign in to comment.