feat(client): fix dark mode

This commit is contained in:
perf3ct 2025-06-13 21:53:25 +00:00
parent 6c0e381de2
commit 667fb26c3d
6 changed files with 110 additions and 27 deletions

View File

@ -199,6 +199,7 @@ const StatsCard: React.FC<StatsCardProps> = ({ title, value, subtitle, icon: Ico
// Recent Documents Component // Recent Documents Component
const RecentDocuments: React.FC<RecentDocumentsProps> = ({ documents = [] }) => { const RecentDocuments: React.FC<RecentDocumentsProps> = ({ documents = [] }) => {
const navigate = useNavigate(); const navigate = useNavigate();
const theme = useTheme();
const getFileIcon = (mimeType?: string): React.ComponentType<any> => { const getFileIcon = (mimeType?: string): React.ComponentType<any> => {
if (mimeType?.includes('pdf')) return PdfIcon; if (mimeType?.includes('pdf')) return PdfIcon;
@ -227,9 +228,13 @@ const RecentDocuments: React.FC<RecentDocumentsProps> = ({ documents = [] }) =>
return ( return (
<Card elevation={0} sx={{ <Card elevation={0} sx={{
background: 'linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%)', background: theme.palette.mode === 'light'
? 'linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%)'
: 'linear-gradient(180deg, rgba(40,40,40,0.95) 0%, rgba(25,25,25,0.95) 100%)',
backdropFilter: 'blur(20px)', backdropFilter: 'blur(20px)',
border: '1px solid rgba(226,232,240,0.5)', border: theme.palette.mode === 'light'
? '1px solid rgba(226,232,240,0.5)'
: '1px solid rgba(255,255,255,0.1)',
borderRadius: 3, borderRadius: 3,
}}> }}>
<CardContent sx={{ p: 3 }}> <CardContent sx={{ p: 3 }}>
@ -237,7 +242,9 @@ const RecentDocuments: React.FC<RecentDocumentsProps> = ({ documents = [] }) =>
<Typography variant="h6" sx={{ <Typography variant="h6" sx={{
fontWeight: 700, fontWeight: 700,
letterSpacing: '-0.025em', letterSpacing: '-0.025em',
background: 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)', background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)'
: 'linear-gradient(135deg, #f8fafc 0%, #a855f7 100%)',
backgroundClip: 'text', backgroundClip: 'text',
WebkitBackgroundClip: 'text', WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent', WebkitTextFillColor: 'transparent',
@ -365,6 +372,7 @@ const RecentDocuments: React.FC<RecentDocumentsProps> = ({ documents = [] }) =>
// Quick Actions Component // Quick Actions Component
const QuickActions: React.FC = () => { const QuickActions: React.FC = () => {
const navigate = useNavigate(); const navigate = useNavigate();
const theme = useTheme();
const actions: QuickAction[] = [ const actions: QuickAction[] = [
{ {
@ -392,16 +400,22 @@ const QuickActions: React.FC = () => {
return ( return (
<Card elevation={0} sx={{ <Card elevation={0} sx={{
background: 'linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%)', background: theme.palette.mode === 'light'
? 'linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%)'
: 'linear-gradient(180deg, rgba(40,40,40,0.95) 0%, rgba(25,25,25,0.95) 100%)',
backdropFilter: 'blur(20px)', backdropFilter: 'blur(20px)',
border: '1px solid rgba(226,232,240,0.5)', border: theme.palette.mode === 'light'
? '1px solid rgba(226,232,240,0.5)'
: '1px solid rgba(255,255,255,0.1)',
borderRadius: 3, borderRadius: 3,
}}> }}>
<CardContent sx={{ p: 3 }}> <CardContent sx={{ p: 3 }}>
<Typography variant="h6" sx={{ <Typography variant="h6" sx={{
fontWeight: 700, fontWeight: 700,
letterSpacing: '-0.025em', letterSpacing: '-0.025em',
background: 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)', background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)'
: 'linear-gradient(135deg, #f8fafc 0%, #a855f7 100%)',
backgroundClip: 'text', backgroundClip: 'text',
WebkitBackgroundClip: 'text', WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent', WebkitTextFillColor: 'transparent',
@ -417,9 +431,13 @@ const QuickActions: React.FC = () => {
sx={{ sx={{
p: 2.5, p: 2.5,
cursor: 'pointer', cursor: 'pointer',
border: '1px solid rgba(226,232,240,0.5)', border: theme.palette.mode === 'light'
? '1px solid rgba(226,232,240,0.5)'
: '1px solid rgba(255,255,255,0.1)',
borderRadius: 3, borderRadius: 3,
background: 'linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(248,250,252,0.6) 100%)', background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(248,250,252,0.6) 100%)'
: 'linear-gradient(135deg, rgba(50,50,50,0.8) 0%, rgba(30,30,30,0.6) 100%)',
backdropFilter: 'blur(10px)', backdropFilter: 'blur(10px)',
transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)', transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
'&:hover': { '&:hover': {
@ -527,7 +545,9 @@ const Dashboard: React.FC = () => {
fontWeight: 800, fontWeight: 800,
mb: 1, mb: 1,
letterSpacing: '-0.025em', letterSpacing: '-0.025em',
background: 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)', background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)'
: 'linear-gradient(135deg, #f8fafc 0%, #a855f7 100%)',
backgroundClip: 'text', backgroundClip: 'text',
WebkitBackgroundClip: 'text', WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent', WebkitTextFillColor: 'transparent',

View File

@ -146,7 +146,9 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
<Typography variant="h6" sx={{ <Typography variant="h6" sx={{
fontWeight: 800, fontWeight: 800,
color: 'text.primary', color: 'text.primary',
background: 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)', background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)'
: 'linear-gradient(135deg, #f8fafc 0%, #a855f7 100%)',
backgroundClip: 'text', backgroundClip: 'text',
WebkitBackgroundClip: 'text', WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent', WebkitTextFillColor: 'transparent',
@ -248,8 +250,12 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
{/* User Info */} {/* User Info */}
<Box sx={{ <Box sx={{
p: 3, p: 3,
borderTop: '1px solid rgba(226,232,240,0.3)', borderTop: theme.palette.mode === 'light'
background: 'linear-gradient(135deg, rgba(99,102,241,0.03) 0%, rgba(139,92,246,0.03) 100%)', ? '1px solid rgba(226,232,240,0.3)'
: '1px solid rgba(255,255,255,0.1)',
background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, rgba(99,102,241,0.03) 0%, rgba(139,92,246,0.03) 100%)'
: 'linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(139,92,246,0.08) 100%)',
}}> }}>
<Box sx={{ <Box sx={{
display: 'flex', display: 'flex',
@ -257,10 +263,16 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
gap: 2.5, gap: 2.5,
p: 2, p: 2,
borderRadius: 3, borderRadius: 3,
background: 'linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(248,250,252,0.6) 100%)', background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(248,250,252,0.6) 100%)'
: 'linear-gradient(135deg, rgba(50,50,50,0.8) 0%, rgba(30,30,30,0.6) 100%)',
backdropFilter: 'blur(10px)', backdropFilter: 'blur(10px)',
border: '1px solid rgba(255,255,255,0.3)', border: theme.palette.mode === 'light'
boxShadow: '0 4px 16px rgba(0,0,0,0.04)', ? '1px solid rgba(255,255,255,0.3)'
: '1px solid rgba(255,255,255,0.1)',
boxShadow: theme.palette.mode === 'light'
? '0 4px 16px rgba(0,0,0,0.04)'
: '0 4px 16px rgba(0,0,0,0.2)',
}}> }}>
<Avatar <Avatar
sx={{ sx={{
@ -338,7 +350,9 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
<Typography variant="h6" noWrap component="div" sx={{ <Typography variant="h6" noWrap component="div" sx={{
fontWeight: 700, fontWeight: 700,
mr: 2, mr: 2,
background: 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)', background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)'
: 'linear-gradient(135deg, #f8fafc 0%, #a855f7 100%)',
backgroundClip: 'text', backgroundClip: 'text',
WebkitBackgroundClip: 'text', WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent', WebkitTextFillColor: 'transparent',
@ -357,9 +371,13 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
sx={{ sx={{
mr: 2, mr: 2,
color: 'text.secondary', color: 'text.secondary',
background: 'linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(248,250,252,0.6) 100%)', background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(248,250,252,0.6) 100%)'
: 'linear-gradient(135deg, rgba(50,50,50,0.8) 0%, rgba(30,30,30,0.6) 100%)',
backdropFilter: 'blur(10px)', backdropFilter: 'blur(10px)',
border: '1px solid rgba(255,255,255,0.3)', border: theme.palette.mode === 'light'
? '1px solid rgba(255,255,255,0.3)'
: '1px solid rgba(255,255,255,0.1)',
borderRadius: 2.5, borderRadius: 2.5,
width: 44, width: 44,
height: 44, height: 44,
@ -412,9 +430,13 @@ const AppLayout: React.FC<AppLayoutProps> = ({ children }) => {
onClick={handleProfileMenuOpen} onClick={handleProfileMenuOpen}
sx={{ sx={{
color: 'text.secondary', color: 'text.secondary',
background: 'linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(248,250,252,0.6) 100%)', background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(248,250,252,0.6) 100%)'
: 'linear-gradient(135deg, rgba(50,50,50,0.8) 0%, rgba(30,30,30,0.6) 100%)',
backdropFilter: 'blur(10px)', backdropFilter: 'blur(10px)',
border: '1px solid rgba(255,255,255,0.3)', border: theme.palette.mode === 'light'
? '1px solid rgba(255,255,255,0.3)'
: '1px solid rgba(255,255,255,0.1)',
borderRadius: 2.5, borderRadius: 2.5,
width: 44, width: 44,
height: 44, height: 44,

View File

@ -22,8 +22,10 @@ const ThemeToggle: React.FC<ThemeToggleProps> = ({
size={size} size={size}
sx={{ sx={{
transition: 'all 0.3s ease-in-out', transition: 'all 0.3s ease-in-out',
color: mode === 'light' ? '#6366f1' : '#fbbf24',
'&:hover': { '&:hover': {
transform: 'rotate(180deg)', transform: 'rotate(180deg)',
color: mode === 'light' ? '#4f46e5' : '#f59e0b',
}, },
}} }}
> >

View File

@ -40,9 +40,10 @@ const createAppTheme = (mode: PaletteMode): Theme => {
paper: mode === 'light' ? '#ffffff' : '#1e1e1e', paper: mode === 'light' ? '#ffffff' : '#1e1e1e',
}, },
text: { text: {
primary: mode === 'light' ? '#333333' : '#ffffff', primary: mode === 'light' ? '#333333' : '#f8fafc',
secondary: mode === 'light' ? '#666666' : '#b0b0b0', secondary: mode === 'light' ? '#666666' : '#cbd5e1',
}, },
divider: mode === 'light' ? 'rgba(0, 0, 0, 0.12)' : 'rgba(255, 255, 255, 0.12)',
}, },
typography: { typography: {
fontFamily: [ fontFamily: [
@ -112,6 +113,20 @@ const createAppTheme = (mode: PaletteMode): Theme => {
}, },
}, },
}, },
MuiTextField: {
styleOverrides: {
root: {
'& .MuiOutlinedInput-root': {
'& fieldset': {
borderColor: mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)',
},
'&:hover fieldset': {
borderColor: mode === 'light' ? 'rgba(0, 0, 0, 0.87)' : 'rgba(255, 255, 255, 0.87)',
},
},
},
},
},
}, },
}); });
}; };

View File

@ -1186,7 +1186,7 @@ const SearchPage: React.FC = () => {
sx={{ sx={{
p: 1.5, p: 1.5,
mb: 1, mb: 1,
backgroundColor: 'grey.50', backgroundColor: (theme) => theme.palette.mode === 'light' ? 'grey.50' : 'grey.800',
borderLeft: '3px solid', borderLeft: '3px solid',
borderLeftColor: 'primary.main', borderLeftColor: 'primary.main',
}} }}

View File

@ -116,7 +116,15 @@ const WatchFolderPage: React.FC = () => {
return ( return (
<Container maxWidth="xl" sx={{ mt: 4, mb: 4 }}> <Container maxWidth="xl" sx={{ mt: 4, mb: 4 }}>
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 4 }}> <Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 4 }}>
<Typography variant="h4" sx={{ fontWeight: 600 }}> <Typography variant="h4" sx={{
fontWeight: 600,
background: theme.palette.mode === 'light'
? 'linear-gradient(135deg, #1e293b 0%, #6366f1 100%)'
: 'linear-gradient(135deg, #f8fafc 0%, #a855f7 100%)',
backgroundClip: 'text',
WebkitBackgroundClip: 'text',
WebkitTextFillColor: 'transparent',
}}>
Watch Folder Watch Folder
</Typography> </Typography>
<Button <Button
@ -148,7 +156,13 @@ const WatchFolderPage: React.FC = () => {
<Typography variant="body2" color="text.secondary"> <Typography variant="body2" color="text.secondary">
Watched Directory Watched Directory
</Typography> </Typography>
<Typography variant="body1" sx={{ fontFamily: 'monospace', bgcolor: 'grey.100', p: 1, borderRadius: 1 }}> <Typography variant="body1" sx={{
fontFamily: 'monospace',
bgcolor: theme.palette.mode === 'light' ? 'grey.100' : 'grey.800',
p: 1,
borderRadius: 1,
color: 'text.primary',
}}>
{watchConfig.watchFolder} {watchConfig.watchFolder}
</Typography> </Typography>
</Box> </Box>
@ -271,7 +285,12 @@ const WatchFolderPage: React.FC = () => {
<Grid container spacing={2} sx={{ mt: 2 }}> <Grid container spacing={2} sx={{ mt: 2 }}>
<Grid item xs={12} md={6}> <Grid item xs={12} md={6}>
<Box sx={{ p: 2, bgcolor: 'grey.50', borderRadius: 2 }}> <Box sx={{
p: 2,
bgcolor: theme.palette.mode === 'light' ? 'grey.50' : 'grey.800',
borderRadius: 2,
border: theme.palette.mode === 'dark' ? '1px solid rgba(255,255,255,0.1)' : 'none',
}}>
<Typography variant="body2" color="text.secondary" sx={{ mb: 1 }}> <Typography variant="body2" color="text.secondary" sx={{ mb: 1 }}>
Average Wait Time Average Wait Time
</Typography> </Typography>
@ -281,7 +300,12 @@ const WatchFolderPage: React.FC = () => {
</Box> </Box>
</Grid> </Grid>
<Grid item xs={12} md={6}> <Grid item xs={12} md={6}>
<Box sx={{ p: 2, bgcolor: 'grey.50', borderRadius: 2 }}> <Box sx={{
p: 2,
bgcolor: theme.palette.mode === 'light' ? 'grey.50' : 'grey.800',
borderRadius: 2,
border: theme.palette.mode === 'dark' ? '1px solid rgba(255,255,255,0.1)' : 'none',
}}>
<Typography variant="body2" color="text.secondary" sx={{ mb: 1 }}> <Typography variant="body2" color="text.secondary" sx={{ mb: 1 }}>
Oldest Pending Item Oldest Pending Item
</Typography> </Typography>