diff --git a/src/app/globals.css b/src/app/globals.css index ffe3d807..8b13cf38 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -39,6 +39,11 @@ html.a11y-high-contrast body { } } +html.dark { + --background: #111827; + --foreground: #f9fafb; +} + body { background: var(--background); color: var(--foreground); diff --git a/src/app/profile/__tests__/ProfileTabs.test.tsx b/src/app/profile/__tests__/ProfileTabs.test.tsx index b66b78aa..19170266 100644 --- a/src/app/profile/__tests__/ProfileTabs.test.tsx +++ b/src/app/profile/__tests__/ProfileTabs.test.tsx @@ -1,11 +1,16 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { describe, expect, it } from 'vitest'; +import { ThemeProvider } from '@/lib/theme-provider'; import ProfileTabs from '../components/ProfileTabs'; +function renderWithTheme(ui: React.ReactElement) { + return render({ui}); +} + describe('ProfileTabs', () => { it('renders the profile panel first to keep initial work minimal', () => { - render(); + renderWithTheme(); expect(screen.getByRole('tab', { name: 'Profile' })).toHaveAttribute('aria-selected', 'true'); expect(screen.getByRole('tabpanel', { name: 'Profile' })).toBeInTheDocument(); @@ -17,7 +22,7 @@ describe('ProfileTabs', () => { it('loads settings only when the settings tab is selected', async () => { const user = userEvent.setup(); - render(); + renderWithTheme(); await user.click(screen.getByRole('tab', { name: 'Settings' })); await waitFor(() => @@ -33,7 +38,7 @@ describe('ProfileTabs', () => { it('loads achievements only when the achievements tab is selected', async () => { const user = userEvent.setup(); - render(); + renderWithTheme(); await user.click(screen.getByRole('tab', { name: 'Achievements' })); await waitFor(() => @@ -50,7 +55,7 @@ describe('ProfileTabs', () => { it('loads certificates only when the certificates tab is selected', async () => { const user = userEvent.setup(); - render(); + renderWithTheme(); await user.click(screen.getByRole('tab', { name: 'Certification Program' })); await waitFor(() => diff --git a/src/app/profile/components/AchievementsPanel.tsx b/src/app/profile/components/AchievementsPanel.tsx index 842b71eb..6b3637c7 100644 --- a/src/app/profile/components/AchievementsPanel.tsx +++ b/src/app/profile/components/AchievementsPanel.tsx @@ -10,13 +10,13 @@ interface AchievementCardProps { const AchievementCard = memo(function AchievementCard({ achievement }: AchievementCardProps) { return ( -
+
-

{achievement.title}

-

{achievement.description}

-

{achievement.earnedAt}

+

{achievement.title}

+

{achievement.description}

+

{achievement.earnedAt}

); }); @@ -27,9 +27,9 @@ function AchievementsPanel() { id="achievements-panel" role="tabpanel" aria-labelledby="achievements-tab" - className="rounded-lg bg-white p-6 shadow" + className="rounded-lg bg-white dark:bg-gray-800 p-6 shadow transition-colors duration-200" > -

Achievements

+

Achievements

{achievements.map((achievement) => ( diff --git a/src/app/profile/components/CertificatesPanel.tsx b/src/app/profile/components/CertificatesPanel.tsx index bd744238..68385a7e 100644 --- a/src/app/profile/components/CertificatesPanel.tsx +++ b/src/app/profile/components/CertificatesPanel.tsx @@ -50,7 +50,7 @@ function CertificatesPanel() { id="certificates-panel" role="tabpanel" aria-labelledby="certificates-tab" - className="rounded-lg bg-white p-6 shadow dark:bg-gray-900" + className="rounded-lg bg-white dark:bg-gray-800 p-6 shadow transition-colors duration-200" >

diff --git a/src/app/profile/components/CustomerSupportPanel.tsx b/src/app/profile/components/CustomerSupportPanel.tsx index 39505250..15df44fb 100644 --- a/src/app/profile/components/CustomerSupportPanel.tsx +++ b/src/app/profile/components/CustomerSupportPanel.tsx @@ -20,7 +20,7 @@ function FaqItem({ id, question, answer }: FaqItemProps) { const toggle = useCallback(() => setIsOpen((prev) => !prev), []); return ( -

+

@@ -44,7 +52,7 @@ function FaqItem({ id, question, answer }: FaqItemProps) { role="region" aria-labelledby={headingId} hidden={!isOpen} - className="px-4 pb-4 text-sm text-gray-600 leading-relaxed" + className="px-4 pb-4 text-sm text-gray-600 dark:text-gray-300 leading-relaxed" > {answer}
@@ -78,15 +86,15 @@ function ContactForm() {
-

+

✅ Your message has been sent. We'll get back to you within 24 hours.

@@ -97,7 +105,10 @@ function ContactForm() { return (
-
-