mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-16 01:32:02 +10:00
Fix-Gengar Theme MastHead Icons Disappear on Theme Change
This commit is contained in:
@ -1,5 +1,7 @@
|
|||||||
|
import { css } from '@emotion/css';
|
||||||
import { alpha } from '@mui/material';
|
import { alpha } from '@mui/material';
|
||||||
import { Theme } from '@reactive-resume/schema';
|
import { Theme } from '@reactive-resume/schema';
|
||||||
|
import clsx from 'clsx';
|
||||||
import get from 'lodash/get';
|
import get from 'lodash/get';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
@ -19,12 +21,16 @@ const Gengar: React.FC<PageProps> = ({ page }) => {
|
|||||||
const theme: Theme = useAppSelector((state) => get(state.resume, 'metadata.theme', {}));
|
const theme: Theme = useAppSelector((state) => get(state.resume, 'metadata.theme', {}));
|
||||||
const contrast = useMemo(() => getContrastColor(theme.primary), [theme.primary]);
|
const contrast = useMemo(() => getContrastColor(theme.primary), [theme.primary]);
|
||||||
const backgroundColor: string = useMemo(() => alpha(theme.primary, 0.15), [theme.primary]);
|
const backgroundColor: string = useMemo(() => alpha(theme.primary, 0.15), [theme.primary]);
|
||||||
|
const color = useMemo(() => (contrast === 'dark' ? theme.text : theme.background), [theme, contrast]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.page}>
|
<div className={styles.page}>
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<div className={styles.sidebar}>
|
<div className={styles.sidebar}>
|
||||||
<div style={{ color: contrast === 'dark' ? theme.text : theme.background, backgroundColor: theme.primary }}>
|
<div
|
||||||
|
className={clsx(css(`svg { color: ${color} } --primary-color: ${color}`))}
|
||||||
|
style={{ color: contrast === 'dark' ? theme.text : theme.background, backgroundColor: theme.primary }}
|
||||||
|
>
|
||||||
{isFirstPage && <MastheadSidebar />}
|
{isFirstPage && <MastheadSidebar />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user