mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-25 06:01:29 +10:00
🚀 release v3.0.0
This commit is contained in:
37
client/templates/Glalie/Glalie.tsx
Normal file
37
client/templates/Glalie/Glalie.tsx
Normal file
@ -0,0 +1,37 @@
|
||||
import { alpha } from '@mui/material';
|
||||
import get from 'lodash/get';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { useAppSelector } from '@/store/hooks';
|
||||
import { PageProps } from '@/utils/template';
|
||||
|
||||
import { getSectionById } from '../sectionMap';
|
||||
import styles from './Glalie.module.scss';
|
||||
import { MastheadMain, MastheadSidebar } from './widgets/Masthead';
|
||||
import Section from './widgets/Section';
|
||||
|
||||
const Glalie: React.FC<PageProps> = ({ page }) => {
|
||||
const isFirstPage = useMemo(() => page === 0, [page]);
|
||||
|
||||
const layout: string[][] = useAppSelector((state) => state.resume.metadata.layout[page]);
|
||||
const primaryColor: string = useAppSelector((state) => get(state.resume, 'metadata.theme.primary'));
|
||||
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<div className={styles.container}>
|
||||
<div className={styles.sidebar} style={{ backgroundColor: alpha(primaryColor, 0.15) }}>
|
||||
{isFirstPage && <MastheadSidebar />}
|
||||
|
||||
{layout[1].map((key) => getSectionById(key, Section))}
|
||||
</div>
|
||||
<div className={styles.main}>
|
||||
{isFirstPage && <MastheadMain />}
|
||||
|
||||
{layout[0].map((key) => getSectionById(key, Section))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Glalie;
|
||||
Reference in New Issue
Block a user