|
1 |
| -/* eslint-disable jsx-a11y/no-autofocus */ |
2 |
| -import React from 'react'; |
3 |
| -import { useDispatch, useSelector } from 'react-redux'; |
4 |
| -import { |
5 |
| - setDarkMode, |
6 |
| - setLightMode, |
7 |
| - selectBackgroundColor, |
8 |
| -} from '../../redux/features/color/colorSlice'; |
9 |
| -import { |
10 |
| - changeVisibility, |
11 |
| - selectVisibility, |
12 |
| -} from '../../redux/features/visibility/visibilitySlice'; |
13 |
| -import './home.scss'; |
| 1 | +import * as React from 'react'; |
| 2 | +import Button from './Button'; |
| 3 | +import Typography from './Typography'; |
| 4 | +import ProductLayout from './PageLayout'; |
| 5 | +import Theme from '../../styles/muiTheme'; |
14 | 6 |
|
15 |
| -function Home() { |
16 |
| - const backgroundColor = useSelector(selectBackgroundColor); |
17 |
| - const visibility = useSelector(selectVisibility); |
18 |
| - const dispatch = useDispatch(); |
| 7 | +const backgroundImage = |
| 8 | + 'https://images.unsplash.com/photo-1534854638093-bada1813ca19?auto=format&fit=crop&w=1400&q=80'; |
19 | 9 |
|
| 10 | +export default function Home() { |
20 | 11 | return (
|
21 |
| - <div className="welcome" style={{ backgroundColor }}> |
22 |
| - <b> |
23 |
| - Welcome to <i>BAREFOOT NOMAD.</i> |
24 |
| - </b> |
25 |
| - <button |
26 |
| - onClick={() => { |
27 |
| - dispatch(setDarkMode()); |
28 |
| - dispatch(changeVisibility()); |
29 |
| - }} |
30 |
| - type="button" |
31 |
| - autoFocus={visibility} |
| 12 | + <ProductLayout |
| 13 | + sxBackground={{ |
| 14 | + backgroundImage: `url(${backgroundImage})`, |
| 15 | + backgroundColor: Theme.imageColor, // Average color of the background image. |
| 16 | + backgroundPosition: 'center', |
| 17 | + }} |
| 18 | + > |
| 19 | + {/* Increase the network loading priority of the background image. */} |
| 20 | + <img |
| 21 | + style={{ display: 'none' }} |
| 22 | + src={backgroundImage} |
| 23 | + alt="increase priority" |
| 24 | + /> |
| 25 | + <Typography color="inherit" align="center" variant="h2" marked="center"> |
| 26 | + Welcome to Barefoot Nomad |
| 27 | + </Typography> |
| 28 | + <Typography |
| 29 | + color="inherit" |
| 30 | + align="center" |
| 31 | + variant="h5" |
| 32 | + sx={{ mb: 4, mt: { sx: 4, sm: 10 } }} |
32 | 33 | >
|
33 |
| - Dark mode |
34 |
| - </button> |
35 |
| - <button |
36 |
| - onClick={() => { |
37 |
| - dispatch(setLightMode()); |
38 |
| - dispatch(changeVisibility()); |
39 |
| - }} |
40 |
| - type="button" |
41 |
| - autoFocus={!visibility} |
| 34 | + Best Travel Service Provider |
| 35 | + </Typography> |
| 36 | + <Button |
| 37 | + color="secondary" |
| 38 | + size="large" |
| 39 | + variant="contained" |
| 40 | + component="a" |
| 41 | + href="/" |
| 42 | + sx={{ mt: 8 }} |
42 | 43 | >
|
43 |
| - Light mode |
44 |
| - </button> |
45 |
| - </div> |
| 44 | + Get started |
| 45 | + </Button> |
| 46 | + <Typography variant="body2" color="inherit" sx={{ mt: 2 }}> |
| 47 | + Discover the experience |
| 48 | + </Typography> |
| 49 | + </ProductLayout> |
46 | 50 | );
|
47 | 51 | }
|
48 |
| - |
49 |
| -export default Home; |
|
0 commit comments