import { css } from '@emotion/css'; import { alpha } from '@mui/material'; import { Theme } from '@reactive-resume/schema'; import clsx from 'clsx'; import get from 'lodash/get'; import { useMemo } from 'react'; import { useAppSelector } from '@/store/hooks'; import { getContrastColor } from '@/utils/styles'; import { PageProps } from '@/utils/template'; import { getSectionById } from '../sectionMap'; import styles from './Gengar.module.scss'; import { MastheadMain, MastheadSidebar } from './widgets/Masthead'; import Section from './widgets/Section'; const Gengar: React.FC = ({ page }) => { const isFirstPage = useMemo(() => page === 0, [page]); const layout: string[][] = useAppSelector((state) => state.resume.metadata.layout[page]); const theme: Theme = useAppSelector((state) => get(state.resume, 'metadata.theme', {})); const contrast = useMemo(() => getContrastColor(theme.primary), [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 (
{isFirstPage && }
{layout[1].map((key) => getSectionById(key, Section))}
{isFirstPage && }
{layout[0].map((key) => getSectionById(key, Section))}
); }; export default Gengar;