-
Notifications
You must be signed in to change notification settings - Fork 1
/
LandingPage.js
97 lines (91 loc) · 2.98 KB
/
LandingPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import React, { useContext } from "react";
import { Link, useHistory } from "react-router-dom";
import { StateContext } from "../contextAPI/StateProvider";
import { auth } from "../Firebase";
import { userId } from "../utils";
import LandingImage from "../assets/landingImage.png";
import ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';
function LandingPage() {
const history = useHistory();
const [{ user }, dispatch] = useContext(StateContext);
const currentUserEmail = user?.email;
const handleLogout = () => {
if (user) {
history.push("/");
auth.signOut();
}
};
return (
<div id="landing-page">
<div className="inner">
<div className="container">
{/* header section */}
<header className="desktop-header">
<Link to="/" className="logo link">
<span>Frontend</span>Team
</Link>
<div className="header-right">
{user ? (
<>
<a onClick={handleLogout}>Logout</a>
</>
) : (
<Link to="/register">
<div>Login</div>
</Link>
)}
</div>
</header>
{/* body section */}
<div className="error-for-public-user">
{user ? (
userId.includes(user.uid) ? (
""
) : (
<p>
<span> Hey {`${currentUserEmail.split("@")[0]}`}, </span>
<br/>
<ErrorOutlineIcon/> You do not have permission to access.
If you think this is incorrect, please contact administrator.
</p>
)
) : (
""
)}
</div>
<section className="landing-body">
<div className="row">
<div className="col-md-4 col-xs-12">
<div className="banner-container">
<p className="banner-text">Talk, share and have fun.</p>
<div className="small-description">
Schedule meetings with team. Discuss interesting things you found while doing research,
and share your knowledge with everyone.
</div>
<div className="button-container">
<Link to="/" className="button">
Discover More
</Link>
</div>
</div>
</div>
<div className="col-md-8 col-xs-12">
<img src={LandingImage} alt="landing image" />
</div>
</div>
</section>
{/* footer section */}
<section className="footer">
<p>
Made with{" "}
<span role="img" aria-label="">
♥️
</span>{" "}
</p>
</section>
</div>
</div>
</div>
);
}
export default LandingPage;