mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 16:51:33 +10:00
adding Pikachu template to the mix
This commit is contained in:
@ -5,23 +5,36 @@ import Onyx from '../../templates/onyx';
|
||||
import LeftSidebar from '../LeftSidebar/LeftSidebar';
|
||||
import RightSidebar from '../RightSidebar/RightSidebar';
|
||||
import AppContext from '../../context/AppContext';
|
||||
import Pikachu from '../../templates/pikachu/Pikachu';
|
||||
|
||||
const App = () => {
|
||||
const context = useContext(AppContext);
|
||||
const { dispatch } = context;
|
||||
const { state, dispatch } = context;
|
||||
const { theme } = state;
|
||||
|
||||
useEffect(() => {
|
||||
const state = JSON.parse(localStorage.getItem('state'));
|
||||
dispatch({ type: 'import_data', payload: state });
|
||||
const storedState = JSON.parse(localStorage.getItem('state'));
|
||||
dispatch({ type: 'import_data', payload: storedState });
|
||||
}, [dispatch]);
|
||||
|
||||
const renderTemplate = () => {
|
||||
switch (theme.layout) {
|
||||
case 'Onyx':
|
||||
return <Onyx />;
|
||||
case 'Pikachu':
|
||||
return <Pikachu />;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="h-screen overflow-hidden grid grid-cols-5 items-center">
|
||||
<LeftSidebar />
|
||||
|
||||
<div className="z-0 h-screen col-span-3 flex justify-center items-center overflow-scroll">
|
||||
<div id="page" className="p-10 my-auto shadow-2xl overflow-scroll">
|
||||
<Onyx />
|
||||
{renderTemplate()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user