From dac176f0c6f8fcf4ba84f087f28f6f429a2922d6 Mon Sep 17 00:00:00 2001 From: Reece Browne Date: Wed, 17 Sep 2025 12:07:44 +0100 Subject: [PATCH] Fix colours --- .../src/components/viewer/EmbedPdfViewer.tsx | 2 -- .../src/components/viewer/LocalEmbedPDF.tsx | 21 +++++------ .../components/viewer/ThumbnailSidebar.tsx | 35 +++++++++---------- 3 files changed, 25 insertions(+), 33 deletions(-) diff --git a/frontend/src/components/viewer/EmbedPdfViewer.tsx b/frontend/src/components/viewer/EmbedPdfViewer.tsx index 89eb08738..b4590db00 100644 --- a/frontend/src/components/viewer/EmbedPdfViewer.tsx +++ b/frontend/src/components/viewer/EmbedPdfViewer.tsx @@ -175,7 +175,6 @@ const EmbedPdfViewerContent = ({ @@ -219,7 +218,6 @@ const EmbedPdfViewerContent = ({ ); diff --git a/frontend/src/components/viewer/LocalEmbedPDF.tsx b/frontend/src/components/viewer/LocalEmbedPDF.tsx index ac090cccd..f9a8e3fc9 100644 --- a/frontend/src/components/viewer/LocalEmbedPDF.tsx +++ b/frontend/src/components/viewer/LocalEmbedPDF.tsx @@ -31,15 +31,12 @@ import { RotateAPIBridge } from './RotateAPIBridge'; interface LocalEmbedPDFProps { file?: File | Blob; url?: string | null; - colorScheme: 'light' | 'dark' | 'auto'; + colorScheme?: 'light' | 'dark' | 'auto'; // Optional since we use CSS variables } -export function LocalEmbedPDF({ file, url, colorScheme }: LocalEmbedPDFProps) { +export function LocalEmbedPDF({ file, url }: LocalEmbedPDFProps) { const [pdfUrl, setPdfUrl] = useState(null); - // Convert color scheme (handle 'auto' mode by defaulting to 'light') - const actualColorScheme = colorScheme === 'auto' ? 'light' : colorScheme; - // Convert File to URL if needed useEffect(() => { if (file) { @@ -129,8 +126,8 @@ export function LocalEmbedPDF({ file, url, colorScheme }: LocalEmbedPDFProps) { justifyContent: 'center', alignItems: 'center', height: '100%', - background: actualColorScheme === 'dark' ? '#1a1b1e' : '#f8f9fa', - color: actualColorScheme === 'dark' ? '#ffffff' : '#666666', + background: 'var(--bg-surface)', + color: 'var(--text-secondary)', }}>
📄
@@ -147,8 +144,8 @@ export function LocalEmbedPDF({ file, url, colorScheme }: LocalEmbedPDFProps) { justifyContent: 'center', alignItems: 'center', height: '100%', - background: actualColorScheme === 'dark' ? '#1a1b1e' : '#f1f3f5', - color: actualColorScheme === 'dark' ? '#ffffff' : '#666666', + background: 'var(--bg-surface)', + color: 'var(--text-secondary)', }}>
@@ -165,8 +162,8 @@ export function LocalEmbedPDF({ file, url, colorScheme }: LocalEmbedPDFProps) { justifyContent: 'center', alignItems: 'center', height: '100%', - background: actualColorScheme === 'dark' ? '#1a1b1e' : '#f1f3f5', - color: '#ff6b6b', + background: 'var(--bg-surface)', + color: 'var(--color-red-500)', }}>
@@ -199,7 +196,7 @@ export function LocalEmbedPDF({ file, url, colorScheme }: LocalEmbedPDFProps) { void; - colorScheme: 'light' | 'dark' | 'auto'; + colorScheme?: 'light' | 'dark' | 'auto'; // Optional since we use CSS variables } -export function ThumbnailSidebar({ visible, onToggle: _onToggle, colorScheme }: ThumbnailSidebarProps) { +export function ThumbnailSidebar({ visible, onToggle: _onToggle }: ThumbnailSidebarProps) { const { getScrollState, scrollActions, getThumbnailAPI } = useViewer(); const [thumbnails, setThumbnails] = useState<{ [key: number]: string }>({}); const scrollState = getScrollState(); const thumbnailAPI = getThumbnailAPI(); - // Convert color scheme - const actualColorScheme = colorScheme === 'auto' ? 'light' : colorScheme; - // Generate thumbnails when sidebar becomes visible useEffect(() => { if (!visible || scrollState.totalPages === 0) return; @@ -100,8 +97,8 @@ export function ThumbnailSidebar({ visible, onToggle: _onToggle, colorScheme }: top: 0, bottom: 0, width: '15rem', - backgroundColor: actualColorScheme === 'dark' ? '#1a1b1e' : '#f8f9fa', - borderLeft: `1px solid ${actualColorScheme === 'dark' ? '#373A40' : '#e9ecef'}`, + backgroundColor: 'var(--bg-surface)', + borderLeft: '1px solid var(--border-subtle)', zIndex: 998, display: 'flex', flexDirection: 'column', @@ -125,10 +122,10 @@ export function ThumbnailSidebar({ visible, onToggle: _onToggle, colorScheme }: borderRadius: '8px', padding: '8px', backgroundColor: scrollState.currentPage === pageIndex + 1 - ? (actualColorScheme === 'dark' ? '#364FC7' : '#e7f5ff') + ? 'var(--color-primary-100)' : 'transparent', border: scrollState.currentPage === pageIndex + 1 - ? '2px solid #1c7ed6' + ? '2px solid var(--color-primary-500)' : '2px solid transparent', transition: 'all 0.2s ease', display: 'flex', @@ -138,7 +135,7 @@ export function ThumbnailSidebar({ visible, onToggle: _onToggle, colorScheme }: }} onMouseEnter={(e) => { if (scrollState.currentPage !== pageIndex + 1) { - e.currentTarget.style.backgroundColor = actualColorScheme === 'dark' ? '#25262b' : '#f1f3f5'; + e.currentTarget.style.backgroundColor = 'var(--hover-bg)'; } }} onMouseLeave={(e) => { @@ -157,20 +154,20 @@ export function ThumbnailSidebar({ visible, onToggle: _onToggle, colorScheme }: height: 'auto', borderRadius: '4px', boxShadow: '0 2px 4px rgba(0, 0, 0, 0.1)', - border: `1px solid ${actualColorScheme === 'dark' ? '#373A40' : '#e9ecef'}` + border: '1px solid var(--border-subtle)' }} /> ) : thumbnails[pageIndex] === 'error' ? (
Failed @@ -179,13 +176,13 @@ export function ThumbnailSidebar({ visible, onToggle: _onToggle, colorScheme }:
Loading... @@ -197,8 +194,8 @@ export function ThumbnailSidebar({ visible, onToggle: _onToggle, colorScheme }: fontSize: '12px', fontWeight: 500, color: scrollState.currentPage === pageIndex + 1 - ? (actualColorScheme === 'dark' ? '#ffffff' : '#1c7ed6') - : (actualColorScheme === 'dark' ? '#adb5bd' : '#6c757d') + ? 'var(--color-primary-500)' + : 'var(--text-muted)' }}> Page {pageIndex + 1}