Skip to content

Commit e77fa4d

Browse files
committed
Add error page
1 parent 6ce97b3 commit e77fa4d

3 files changed

Lines changed: 59 additions & 19 deletions

File tree

src/Pages/Error/ErrorPage.jsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import React from 'react'
2+
import { Box, Heading, Text, Button } from '@chakra-ui/react';
3+
4+
5+
const ErrorPage = () => {
6+
return (
7+
<>
8+
<Box mt={'32'} textAlign="center" py={10} px={6}>
9+
<Heading
10+
display="inline-block"
11+
as="h2"
12+
size="2xl"
13+
bgGradient="linear(to-r, teal.400, teal.600)"
14+
backgroundClip="text">
15+
404
16+
</Heading>
17+
<Text fontSize="18px" mt={3} mb={2}>
18+
Template Not Found
19+
</Text>
20+
<Text color={'gray.500'} mb={6}>
21+
This Page Resume Template is under build, coming soon....
22+
</Text>
23+
24+
<Button
25+
onClick={() => window.location.reload()}
26+
colorScheme="teal"
27+
bgGradient="linear(to-r, teal.400, teal.500, teal.600)"
28+
color="white"
29+
variant="solid">
30+
Select Another Template
31+
</Button>
32+
</Box>
33+
</>
34+
)
35+
}
36+
37+
export default ErrorPage

src/Pages/Home/Home.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Introduction from '../../Components/Intro/Introduction'
33
import ResumeContext from '../../Context/ResumeContext';
44
import BuilderArea from '../BuilderArea';
55
import Theme1 from './../../Theme/Theme1/Theme1'
6-
import Theme2 from './../../Theme/Theme2/Theme2'
6+
import ErrorPage from '../Error/ErrorPage';
77

88
const Home = () => {
99
const { currentTheme, showComponent, themeData, componentRef } = useContext(ResumeContext);
@@ -17,13 +17,13 @@ const Home = () => {
1717
(showComponent && currentTheme === 'Theme1') && <BuilderArea theme={<Theme1 componentRef={componentRef} themeData={themeData} />} />
1818
}
1919
{
20-
(showComponent && currentTheme === 'Theme2') && <BuilderArea theme={<Theme2 componentRef={componentRef} themeData={themeData} />} />
20+
(showComponent && currentTheme === 'Theme2') && <ErrorPage />
2121
}
2222
{
23-
(showComponent && currentTheme === 'Theme3') && <BuilderArea theme={<Theme2 componentRef={componentRef} themeData={themeData} />} />
23+
(showComponent && currentTheme === 'Theme3') && <ErrorPage />
2424
}
2525
{
26-
(showComponent && currentTheme === 'Theme4') && <BuilderArea theme={<Theme2 componentRef={componentRef} themeData={themeData} />} />
26+
(showComponent && currentTheme === 'Theme4') && <ErrorPage />
2727
}
2828
</>
2929
)

src/Theme/Theme1/Theme1.jsx

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { BsFillTelephoneFill } from 'react-icons/bs'
77
import ResumeContext from '../../Context/ResumeContext'
88

99
const Theme1 = (props) => {
10-
const { checkProj, checkWork } = useContext(ResumeContext)
10+
const { checkProj, checkWork, checkAward } = useContext(ResumeContext)
1111
const { themeData, componentRef } = props;
1212
const { name, profile, address, phone, email, skill } = themeData.personalData;
1313
const { projectTitles, projectDesc } = themeData.projectData;
@@ -145,22 +145,25 @@ const Theme1 = (props) => {
145145
</section>
146146
}
147147
{/* Award & Achievement */}
148-
<section id="awards" className='my-2'>
149-
<Heading bg={'#D2E4E1'} as='h3' size='md' px={20} py={2}>
150-
AWARDS & ACHIEVEMENTS
151-
</Heading>
148+
{
149+
!checkAward &&
150+
<section id="awards" className='my-2'>
151+
<Heading bg={'#D2E4E1'} as='h3' size='md' px={20} py={2}>
152+
AWARDS & ACHIEVEMENTS
153+
</Heading>
152154

153-
<Box id='award-set' className='basic-set d-flex justify-content-between align-items-center'>
154-
<div>
155-
{
156-
awards.split(',').map((element, index) => {
157-
return <li key={index}>{element}</li>
158-
})
159-
}
155+
<Box id='award-set' className='basic-set d-flex justify-content-between align-items-center'>
156+
<div>
157+
{
158+
awards.split(',').map((element, index) => {
159+
return <li key={index}>{element}</li>
160+
})
161+
}
160162

161-
</div>
162-
</Box>
163-
</section>
163+
</div>
164+
</Box>
165+
</section>
166+
}
164167
</div>
165168
</div>
166169
</>

0 commit comments

Comments
 (0)