]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/pages/Front.js
restore page after login
[alttp.git] / resources / js / components / pages / Front.js
1 import React from 'react';
2 import { Button, Col, Container, Image, Row } from 'react-bootstrap';
3 import { useNavigate } from 'react-router-dom';
4
5 const Front = () => {
6         const navigate = useNavigate();
7
8         React.useEffect(() => {
9                 const returnPath = localStorage.getItem('returnPath');
10                 if (returnPath) {
11                         localStorage.removeItem('returnPath');
12                         navigate(returnPath);
13                 }
14         }, []);
15
16         return <Container className="mt-5">
17                 <Row>
18                         <Col md={6}>
19                                 <Button
20                                         className="front-panel"
21                                         onClick={() => navigate('/tournaments/6')}
22                                         variant="outline-secondary"
23                                 >
24                                         <Image alt="" className="image" src="/media/alttp/front.png" />
25                                         <div className="title">
26                                                 ALttPR Weekly
27                                         </div>
28                                 </Button>
29                         </Col>
30                         <Col md={6}>
31                                 <Button
32                                         className="front-panel"
33                                         onClick={() => navigate('/tournaments/5')}
34                                         variant="outline-secondary"
35                                 >
36                                         <Image alt="" className="image" src="/media/sm/front.png" />
37                                         <div className="title">
38                                                 Super Metroid
39                                         </div>
40                                 </Button>
41                         </Col>
42                 </Row>
43         </Container>;
44 };
45
46 export default Front;