Skip to content

Commit 2b94caf

Browse files
authored
Merge pull request #233 from El-swaggerito/propchain-2
Propchain 2
2 parents c8be0fc + 50fc809 commit 2b94caf

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

src/app/dashboard/page.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ import { KycStatusBadge } from "@/components/kyc/KycStatusBadge";
1313
import { useKycStore } from "@/store/kycStore";
1414
import Link from "next/link";
1515
import { TransactionSecuritySettings } from "@/components/security/TransactionSecuritySettings";
16-
import { StakingPanel } from "@/components/dashboard/StakingPanel";
1716
import { Skeleton } from "@/components/ui/skeleton";
1817

18+
const StakingPanel = dynamic(
19+
() => import("@/components/dashboard/StakingPanel").then((m) => m.StakingPanel),
20+
{ loading: () => <WidgetSkeleton className="h-[400px]" /> }
21+
);
22+
1923
const PortfolioOverview = dynamic(
2024
() => import("@/components/dashboard/PortfolioOverview").then((m) => m.PortfolioOverview),
2125
{ loading: () => <WidgetSkeleton className="h-40" /> }

src/components/dashboard/RentalIncomeDistribution.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
77
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
88
import { Button } from "@/components/ui/button";
99
import { TrendingUp, Calendar, History } from "lucide-react";
10+
import dynamic from "next/dynamic";
1011
import DistributionHistory from "./RentalIncomeDistribution/DistributionHistory";
1112
import PendingDistributions from "./RentalIncomeDistribution/PendingDistributions";
1213
import DistributionCalendar from "./RentalIncomeDistribution/DistributionCalendar";
13-
import CumulativeIncomeChart from "./RentalIncomeDistribution/CumulativeIncomeChart";
14+
15+
const CumulativeIncomeChart = dynamic(
16+
() => import("./RentalIncomeDistribution/CumulativeIncomeChart"),
17+
{ loading: () => <div className="h-80 bg-muted animate-pulse rounded-lg" /> }
18+
);
1419

1520
export interface Distribution {
1621
id: string;

src/components/ui/chart.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client"
22

33
import * as React from "react"
4-
import * as RechartsPrimitive from "recharts"
4+
import { ResponsiveContainer, Tooltip, Legend, type LegendProps } from "recharts"
55

66
import { cn } from "@/lib/utils"
77

@@ -43,7 +43,7 @@ function ChartContainer({
4343
}: React.ComponentProps<"div"> & {
4444
config: ChartConfig
4545
children: React.ComponentProps<
46-
typeof RechartsPrimitive.ResponsiveContainer
46+
typeof ResponsiveContainer
4747
>["children"]
4848
}) {
4949
const uniqueId = React.useId()
@@ -61,9 +61,9 @@ function ChartContainer({
6161
{...props}
6262
>
6363
<ChartStyle id={chartId} config={config} />
64-
<RechartsPrimitive.ResponsiveContainer>
64+
<ResponsiveContainer>
6565
{children}
66-
</RechartsPrimitive.ResponsiveContainer>
66+
</ResponsiveContainer>
6767
</div>
6868
</ChartContext.Provider>
6969
)
@@ -102,7 +102,7 @@ ${colorConfig
102102
)
103103
}
104104

105-
const ChartTooltip = RechartsPrimitive.Tooltip
105+
const ChartTooltip = Tooltip
106106

107107
function ChartTooltipContent({
108108
active,
@@ -118,7 +118,7 @@ function ChartTooltipContent({
118118
color,
119119
nameKey,
120120
labelKey,
121-
}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
121+
}: React.ComponentProps<typeof Tooltip> &
122122
React.ComponentProps<"div"> & {
123123
hideLabel?: boolean
124124
hideIndicator?: boolean
@@ -250,7 +250,7 @@ function ChartTooltipContent({
250250
)
251251
}
252252

253-
const ChartLegend = RechartsPrimitive.Legend
253+
const ChartLegend = Legend
254254

255255
function ChartLegendContent({
256256
className,
@@ -259,7 +259,7 @@ function ChartLegendContent({
259259
verticalAlign = "bottom",
260260
nameKey,
261261
}: React.ComponentProps<"div"> &
262-
Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
262+
Pick<LegendProps, "payload" | "verticalAlign"> & {
263263
hideIcon?: boolean
264264
nameKey?: string
265265
}) {

0 commit comments

Comments
 (0)