Skip to content

Commit a7fe1f0

Browse files
committed
feat: improve visuals
1 parent cb19b7d commit a7fe1f0

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

src/app/components/Navigation.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,12 @@ export default function Navigation({ showBack = true }: NavigationProps) {
3030
Topics
3131
</Link>
3232

33-
{showBack && (
34-
<button
35-
type="button"
36-
onClick={() => router.back()}
37-
className="px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors text-sm sm:text-base font-inter"
38-
>
39-
Back
40-
</button>
41-
)}
33+
<Link
34+
href="/about"
35+
className="px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg transition-colors text-sm sm:text-base font-inter"
36+
>
37+
About
38+
</Link>
4239

4340
</div>
4441
<Link href="https://dxheroes.io" target="_blank">

src/app/topics/[id]/questions/[difficulty]/QuestionsPage.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { topics } from '../../../../constants/topics';
55
import type { TopicId, Difficulty } from '../../../../constants/topics';
66

77
const difficultyClasses = {
8-
beginner: 'text-electric-violet bg-electric-violet',
9-
intermediate: 'text-purple bg-purple',
10-
advanced: 'text-turquoise bg-turquoise',
8+
beginner: 'text-electric-violet border-electric-violet',
9+
intermediate: 'text-purple border-purple',
10+
advanced: 'text-turquoise border-turquoise',
1111
} as const;
1212

1313
const difficultyNumbers = {
@@ -19,7 +19,7 @@ const difficultyNumbers = {
1919
export default function QuestionsPage(props: { id: string, difficulty: Difficulty, questions: string[] }) {
2020
const { id, difficulty, questions } = props;
2121
const topic = topics[id as TopicId];
22-
const [textColorClass, bgColorClass] = difficultyClasses[difficulty].split(' ');
22+
const [textColorClass] = difficultyClasses[difficulty].split(' ');
2323

2424
if (!topic) {
2525
return null;
@@ -28,17 +28,17 @@ export default function QuestionsPage(props: { id: string, difficulty: Difficult
2828
return (
2929
<div className="min-h-screen bg-gray-50">
3030
<div className="mx-auto max-w-2xl px-4 py-12">
31-
<div className="bg-white text-black p-6 sm:p-12 rounded-lg shadow-lg relative">
31+
<div className="bg-white text-black p-6 sm:p-12 rounded-lg shadow-lg relative border-2 border-opacity-50">
3232
<span className={`absolute top-4 sm:top-8 right-4 sm:right-8 text-3xl sm:text-4xl font-staatliches opacity-90 sm:opacity-100 ${textColorClass}`}>
3333
{difficultyNumbers[difficulty]}
3434
</span>
3535
<h1 className={`text-2xl sm:text-4xl font-staatliches mb-8 sm:mb-12 max-w-[80%] leading-tight whitespace-pre-line ${textColorClass}`}>
3636
{topic.title}
3737
</h1>
3838
<ul className="space-y-6 sm:space-y-8 font-inter">
39-
{questions.map((question, i) => (
40-
<li key={`${id}-${difficulty}-q-${i}`} className="flex items-start gap-3 sm:gap-4">
41-
<span className={`w-2.5 sm:w-3 h-2.5 sm:h-3 rounded-full flex-shrink-0 mt-2 ${bgColorClass}`} />
39+
{questions.map((question) => (
40+
<li key={`${id}-${difficulty}-q-${question.slice(0, 20)}`} className="flex items-start gap-3 sm:gap-4">
41+
<span className={`w-2.5 sm:w-3 h-2.5 sm:h-3 rounded-full flex-shrink-0 mt-2 ${difficultyClasses[difficulty].replace('text-', 'bg-')}`} />
4242
<span className="text-lg sm:text-xl leading-relaxed">{question}</span>
4343
</li>
4444
))}

0 commit comments

Comments
 (0)