Skip to content

Commit f467245

Browse files
committed
Pr fix
1 parent a2c1ee3 commit f467245

File tree

2 files changed

+39
-50
lines changed

2 files changed

+39
-50
lines changed

app/dashboard/page.tsx

+37-50
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
TrendingUp,
1919
CheckCircle,
2020
} from "lucide-react";
21-
import { V2Navbar } from "@/components/DashboardV2/V2Navbar";
2221

2322
export default function Dashboard() {
2423
const { fetchLeetcodeUserProfile, leetcodeUserProfile } = useLeetcodeStore();
@@ -31,7 +30,6 @@ export default function Dashboard() {
3130
}
3231
return (
3332
<div className="flex flex-col p-4 sm:p-6 md:p-8">
34-
<V2Navbar />
3533
<Card className="w-full max-w-4xl mx-auto shadow-xl border-none">
3634
<CardHeader className="flex flex-col sm:flex-row items-center gap-6 pb-6 border-b">
3735
<div className="relative w-32 h-32 sm:w-40 sm:h-40">
@@ -76,41 +74,39 @@ export default function Dashboard() {
7674
<StatItem
7775
icon={<Book className="w-5 h-5 text-blue-500" />}
7876
value={
79-
leetcodeUserProfile.submitStats.acSubmissionNum[0]
80-
.count || 0
77+
leetcodeUserProfile.submitStats.acSubmissionNum[0].count ||
78+
0
8179
}
8280
label="Total Solved"
8381
subtitle={`${(
84-
(leetcodeUserProfile.submitStats.acSubmissionNum[0]
85-
.count /
86-
leetcodeUserProfile.submitStats.totalSubmissionNum[0]
87-
.count) *
82+
(leetcodeUserProfile.submitStats.acSubmissionNum[0].count /
83+
leetcodeUserProfile.submitStats.totalSubmissionNum[0].count) *
8884
100
8985
).toFixed(1)}% success rate`}
9086
/>
9187
<StatItem
9288
icon={<Target className="w-5 h-5 text-green-500" />}
9389
value={
94-
leetcodeUserProfile.submitStats.acSubmissionNum[1]
95-
.count || 0
90+
leetcodeUserProfile.submitStats.acSubmissionNum[1].count ||
91+
0
9692
}
9793
label="Easy Problems"
9894
subtitle={`${leetcodeUserProfile.submitStats.acSubmissionNum[1].submissions} submissions`}
9995
/>
10096
<StatItem
10197
icon={<Target className="w-5 h-5 text-yellow-500" />}
10298
value={
103-
leetcodeUserProfile.submitStats.acSubmissionNum[2]
104-
.count || 0
99+
leetcodeUserProfile.submitStats.acSubmissionNum[2].count ||
100+
0
105101
}
106102
label="Medium Problems"
107103
subtitle={`${leetcodeUserProfile.submitStats.acSubmissionNum[2].submissions} submissions`}
108104
/>
109105
<StatItem
110106
icon={<Target className="w-5 h-5 text-red-500" />}
111107
value={
112-
leetcodeUserProfile.submitStats.acSubmissionNum[3]
113-
.count || 0
108+
leetcodeUserProfile.submitStats.acSubmissionNum[3].count ||
109+
0
114110
}
115111
label="Hard Problems"
116112
subtitle={`${leetcodeUserProfile.submitStats.acSubmissionNum[3].submissions} submissions`}
@@ -133,10 +129,7 @@ export default function Dashboard() {
133129
icon={<Star className="w-5 h-5 text-yellow-500" />}
134130
value={leetcodeUserProfile.profile.starRating}
135131
label="Contest Rating"
136-
subtitle={`Level ${
137-
Math.floor(leetcodeUserProfile.profile.starRating / 500) +
138-
1
139-
}`}
132+
subtitle={`Level ${Math.floor(leetcodeUserProfile.profile.starRating / 500) + 1}`}
140133
/>
141134
<StatItem
142135
icon={<CheckCircle className="w-5 h-5 text-green-500" />}
@@ -148,32 +141,32 @@ export default function Dashboard() {
148141
</div>
149142
</div>
150143
<br></br>
151-
{/* Original Badges */}
152-
<div className="grid gap-6 md:grid-cols-3">
153-
<div className="space-y-4">
154-
<h3 className="text-xl font-semibold mb-6">Recent Badges</h3>
155-
<div className="grid grid-cols-2 sm:grid-cols-3 gap-3">
156-
{leetcodeUserProfile.badges.slice(0, 5).map((badge) => (
157-
<div
158-
key={badge.id}
159-
className="flex flex-col items-center p-2 bg-secondary rounded-lg"
160-
>
161-
<div className="relative w-12 h-12 mb-2">
162-
<Image
163-
src={badge.icon}
164-
alt={badge.displayName}
165-
fill
166-
className="object-contain"
167-
/>
168-
</div>
169-
<span className="text-xs text-center">
170-
{badge.displayName}
171-
</span>
144+
{/* Original Badges */}
145+
<div className="grid gap-6 md:grid-cols-3">
146+
<div className="space-y-4">
147+
<h3 className="text-xl font-semibold mb-6">Recent Badges</h3>
148+
<div className="grid grid-cols-2 sm:grid-cols-3 gap-3">
149+
{leetcodeUserProfile.badges.slice(0, 5).map((badge) => (
150+
<div
151+
key={badge.id}
152+
className="flex flex-col items-center p-2 bg-secondary rounded-lg"
153+
>
154+
<div className="relative w-12 h-12 mb-2">
155+
<Image
156+
src={badge.icon}
157+
alt={badge.displayName}
158+
fill
159+
className="object-contain"
160+
/>
172161
</div>
173-
))}
174-
</div>
162+
<span className="text-xs text-center">
163+
{badge.displayName}
164+
</span>
165+
</div>
166+
))}
175167
</div>
176168
</div>
169+
</div>
177170
{/* Submission Timeline */}
178171
<div className="mt-8">
179172
<h3 className="text-xl font-semibold mb-4 flex items-center">
@@ -184,14 +177,8 @@ export default function Dashboard() {
184177
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
185178
<TimelineStat
186179
label="All Time"
187-
value={
188-
leetcodeUserProfile.submitStats.totalSubmissionNum[0]
189-
.count
190-
}
191-
total={
192-
leetcodeUserProfile.submitStats.totalSubmissionNum[0]
193-
.count
194-
}
180+
value={leetcodeUserProfile.submitStats.totalSubmissionNum[0].count}
181+
total={leetcodeUserProfile.submitStats.totalSubmissionNum[0].count}
195182
/>
196183
</div>
197184
</div>
@@ -317,4 +304,4 @@ function DashboardSkeleton() {
317304
</Card>
318305
</div>
319306
);
320-
}
307+
}

app/page.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { PricingSection } from "@/components/DashboardV2/PricingSection";
99
import { ServicesSection } from "@/components/DashboardV2/ServicesSection";
1010
import { TeamSection } from "@/components/DashboardV2/TeamSection";
1111
import { TestimonialSection } from "@/components/DashboardV2/TestimonialSection";
12+
import { V2Navbar } from "@/components/DashboardV2/V2Navbar";
1213

1314
export const metadata = {
1415
title: "LeetCode Journal - Your Coding Companion",
@@ -41,6 +42,7 @@ export const metadata = {
4142
export default function Home() {
4243
return (
4344
<div className="w-full">
45+
<V2Navbar/>
4446
<HeroSection />
4547
<BenefitsSection />
4648
<FeaturesSection />

0 commit comments

Comments
 (0)