Skip to content

Commit be7d9e7

Browse files
committed
feat(terracotta): route page dispatchers to terracotta variants
1 parent 54ac7a6 commit be7d9e7

13 files changed

Lines changed: 48 additions & 81 deletions

src/pages/AchievementsPage.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import React from 'react';
22
import { useVisualSettings } from '../context/VisualSettingsContext';
33
import BrutalistAchievementsPage from './brutalist-views/BrutalistAchievementsPage';
44
import LuxeAchievementsPage from './luxe-views/LuxeAchievementsPage';
5+
import TerracottaAchievementsPage from './terracotta-views/TerracottaAchievementsPage';
56

67
const AchievementsPage = () => {
78
const { fezcodexTheme } = useVisualSettings();
89

9-
if (fezcodexTheme === 'luxe') {
10-
return <LuxeAchievementsPage />;
11-
}
12-
10+
if (fezcodexTheme === 'luxe') return <LuxeAchievementsPage />;
11+
if (fezcodexTheme === 'terracotta') return <TerracottaAchievementsPage />;
1312
return <BrutalistAchievementsPage />;
1413
};
1514

src/pages/AppPage.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import React from 'react';
22
import { useVisualSettings } from '../context/VisualSettingsContext';
33
import BrutalistAppsPage from './brutalist-views/BrutalistAppsPage';
44
import LuxeAppsPage from './luxe-views/LuxeAppsPage';
5+
import TerracottaAppsPage from './terracotta-views/TerracottaAppsPage';
56

67
const AppPage = () => {
78
const { fezcodexTheme } = useVisualSettings();
89

9-
if (fezcodexTheme === 'luxe') {
10-
return <LuxeAppsPage />;
11-
}
12-
10+
if (fezcodexTheme === 'luxe') return <LuxeAppsPage />;
11+
if (fezcodexTheme === 'terracotta') return <TerracottaAppsPage />;
1312
return <BrutalistAppsPage />;
1413
};
1514

src/pages/BlogPage.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import React from 'react';
22
import { useVisualSettings } from '../context/VisualSettingsContext';
33
import BrutalistBlogPage from './blog-views/BrutalistBlogPage';
44
import LuxeBlogPage from './luxe-views/LuxeBlogPage';
5+
import TerracottaBlogPage from './blog-views/TerracottaBlogPage';
56

67
const BlogPage = () => {
78
const { fezcodexTheme } = useVisualSettings();
89

9-
if (fezcodexTheme === 'luxe') {
10-
return <LuxeBlogPage />;
11-
}
12-
10+
if (fezcodexTheme === 'luxe') return <LuxeBlogPage />;
11+
if (fezcodexTheme === 'terracotta') return <TerracottaBlogPage />;
1312
return <BrutalistBlogPage />;
1413
};
1514

src/pages/BlogPostPage.jsx

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import OldBlogPostPage from './blog-views/OldBlogPostPage';
99
import TerminalBlogPostPage from './blog-views/TerminalBlogPostPage';
1010
import TerminalGreenBlogPostPage from './blog-views/TerminalGreenBlogPostPage';
1111
import LuxeBlogPostPage from './blog-views/LuxeBlogPostPage';
12+
import TerracottaBlogPostPage from './blog-views/TerracottaBlogPostPage';
1213

1314
const BlogPostPage = () => {
1415
const { blogPostViewMode, fezcodexTheme } = useVisualSettings();
1516
const [searchParams] = useSearchParams();
1617

17-
// Determine the effective view mode
1818
const effectiveViewMode = (() => {
1919
const themeParam = searchParams.get('theme');
2020
if (
@@ -28,51 +28,30 @@ const BlogPostPage = () => {
2828
'terminal-green',
2929
'old',
3030
'luxe',
31+
'terracotta',
3132
].includes(themeParam)
3233
) {
3334
return themeParam;
3435
}
3536

36-
// If user has explicitly chosen a mode (other than standard), respect it
3737
if (blogPostViewMode !== 'standard') {
3838
return blogPostViewMode;
3939
}
4040

41-
// Otherwise, adapt to the global theme
42-
if (fezcodexTheme === 'luxe') {
43-
return 'luxe';
44-
}
41+
if (fezcodexTheme === 'luxe') return 'luxe';
42+
if (fezcodexTheme === 'terracotta') return 'terracotta';
4543

4644
return 'brutalist';
4745
})();
4846

49-
if (effectiveViewMode === 'luxe') {
50-
return <LuxeBlogPostPage />;
51-
}
52-
53-
if (effectiveViewMode === 'old') {
54-
return <OldBlogPostPage />;
55-
}
56-
57-
if (effectiveViewMode === 'dossier') {
58-
return <DossierBlogPostPage />;
59-
}
60-
61-
if (effectiveViewMode === 'dokument') {
62-
return <DokumentBlogPostPage />;
63-
}
64-
65-
if (effectiveViewMode === 'editorial') {
66-
return <EditorialBlogPostPage />;
67-
}
68-
69-
if (effectiveViewMode === 'terminal-green') {
70-
return <TerminalGreenBlogPostPage />;
71-
}
72-
73-
if (effectiveViewMode === 'terminal') {
74-
return <TerminalBlogPostPage />;
75-
}
47+
if (effectiveViewMode === 'luxe') return <LuxeBlogPostPage />;
48+
if (effectiveViewMode === 'terracotta') return <TerracottaBlogPostPage />;
49+
if (effectiveViewMode === 'old') return <OldBlogPostPage />;
50+
if (effectiveViewMode === 'dossier') return <DossierBlogPostPage />;
51+
if (effectiveViewMode === 'dokument') return <DokumentBlogPostPage />;
52+
if (effectiveViewMode === 'editorial') return <EditorialBlogPostPage />;
53+
if (effectiveViewMode === 'terminal-green') return <TerminalGreenBlogPostPage />;
54+
if (effectiveViewMode === 'terminal') return <TerminalBlogPostPage />;
7655

7756
return <BrutalistBlogPostPage />;
7857
};

src/pages/CommandsPage.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import React from 'react';
22
import { useVisualSettings } from '../context/VisualSettingsContext';
33
import BrutalistCommandsPage from './brutalist-views/BrutalistCommandsPage';
44
import LuxeCommandsPage from './luxe-views/LuxeCommandsPage';
5+
import TerracottaCommandsPage from './terracotta-views/TerracottaCommandsPage';
56

67
const CommandsPage = () => {
78
const { fezcodexTheme } = useVisualSettings();
89

9-
if (fezcodexTheme === 'luxe') {
10-
return <LuxeCommandsPage />;
11-
}
12-
10+
if (fezcodexTheme === 'luxe') return <LuxeCommandsPage />;
11+
if (fezcodexTheme === 'terracotta') return <TerracottaCommandsPage />;
1312
return <BrutalistCommandsPage />;
1413
};
1514

src/pages/HomePage.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import React from 'react';
22
import { useVisualSettings } from '../context/VisualSettingsContext';
33
import BrutalistHomePage from './brutalist-views/BrutalistHomePage';
44
import LuxeHomePage from './luxe-views/LuxeHomePage';
5+
import TerracottaHomePage from './terracotta-views/TerracottaHomePage';
56

67
const HomePage = () => {
78
const { fezcodexTheme } = useVisualSettings();
89

9-
if (fezcodexTheme === 'luxe') {
10-
return <LuxeHomePage />;
11-
}
12-
10+
if (fezcodexTheme === 'luxe') return <LuxeHomePage />;
11+
if (fezcodexTheme === 'terracotta') return <TerracottaHomePage />;
1312
return <BrutalistHomePage />;
1413
};
1514

src/pages/LogDetailPage.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import React from 'react';
22
import { useVisualSettings } from '../context/VisualSettingsContext';
33
import BrutalistLogDetailPage from './brutalist-views/BrutalistLogDetailPage';
44
import LuxeLogDetailPage from './luxe-views/LuxeLogDetailPage';
5+
import TerracottaLogDetailPage from './terracotta-views/TerracottaLogDetailPage';
56

67
const LogDetailPage = () => {
78
const { fezcodexTheme } = useVisualSettings();
89

9-
if (fezcodexTheme === 'luxe') {
10-
return <LuxeLogDetailPage />;
11-
}
12-
10+
if (fezcodexTheme === 'luxe') return <LuxeLogDetailPage />;
11+
if (fezcodexTheme === 'terracotta') return <TerracottaLogDetailPage />;
1312
return <BrutalistLogDetailPage />;
1413
};
1514

src/pages/LogsPage.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import React from 'react';
22
import { useVisualSettings } from '../context/VisualSettingsContext';
33
import BrutalistLogsPage from './brutalist-views/BrutalistLogsPage';
44
import LuxeLogsPage from './luxe-views/LuxeLogsPage';
5+
import TerracottaLogsPage from './terracotta-views/TerracottaLogsPage';
56

67
const LogsPage = () => {
78
const { fezcodexTheme } = useVisualSettings();
89

9-
if (fezcodexTheme === 'luxe') {
10-
return <LuxeLogsPage />;
11-
}
12-
10+
if (fezcodexTheme === 'luxe') return <LuxeLogsPage />;
11+
if (fezcodexTheme === 'terracotta') return <TerracottaLogsPage />;
1312
return <BrutalistLogsPage />;
1413
};
1514

src/pages/PinnedAppPage.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import React from 'react';
22
import { useVisualSettings } from '../context/VisualSettingsContext';
33
import BrutalistPinnedAppPage from './brutalist-views/BrutalistPinnedAppPage';
44
import LuxePinnedAppsPage from './luxe-views/LuxePinnedAppsPage';
5+
import TerracottaPinnedAppPage from './terracotta-views/TerracottaPinnedAppPage';
56

67
const PinnedAppPage = () => {
78
const { fezcodexTheme } = useVisualSettings();
89

9-
if (fezcodexTheme === 'luxe') {
10-
return <LuxePinnedAppsPage />;
11-
}
12-
10+
if (fezcodexTheme === 'luxe') return <LuxePinnedAppsPage />;
11+
if (fezcodexTheme === 'terracotta') return <TerracottaPinnedAppPage />;
1312
return <BrutalistPinnedAppPage />;
1413
};
1514

src/pages/ProjectsPage.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import React from 'react';
22
import { useVisualSettings } from '../context/VisualSettingsContext';
33
import BrutalistProjectsPage from './brutalist-views/BrutalistProjectsPage';
44
import LuxeProjectsPage from './luxe-views/LuxeProjectsPage';
5+
import TerracottaProjectsPage from './terracotta-views/TerracottaProjectsPage';
56

67
const ProjectsPage = () => {
78
const { fezcodexTheme } = useVisualSettings();
89

9-
if (fezcodexTheme === 'luxe') {
10-
return <LuxeProjectsPage />;
11-
}
12-
10+
if (fezcodexTheme === 'luxe') return <LuxeProjectsPage />;
11+
if (fezcodexTheme === 'terracotta') return <TerracottaProjectsPage />;
1312
return <BrutalistProjectsPage />;
1413
};
1514

0 commit comments

Comments
 (0)