1
1
/* eslint react/prefer-stateless-function: 0 */
2
2
/* eslint no-undef: 0 */
3
- import React , { Component } from 'react' ;
3
+ import React from 'react' ;
4
4
import { Route } from 'react-router-dom' ;
5
5
import ReactGA from 'react-ga' ;
6
6
import MessengerCustomerChat from 'react-messenger-customer-chat' ;
7
7
8
8
import { ThemeProvider } from 'styled-components' ;
9
9
10
- // Font Awesome
11
10
import { library } from '@fortawesome/fontawesome-svg-core' ;
12
11
import {
13
12
faPlus ,
@@ -20,8 +19,6 @@ import {
20
19
} from '@fortawesome/free-solid-svg-icons' ;
21
20
22
21
import { Container } from 'reactstrap' ;
23
- import withAuthentication from '../utils/withAuthentication' ;
24
-
25
22
import Navbar from '../shared/navbar' ;
26
23
import Footer from '../shared/footer' ;
27
24
@@ -35,6 +32,7 @@ import ExploreProjects from '../explore-projects';
35
32
import ForgotPassword from '../forgot-password' ;
36
33
37
34
import './App.css' ;
35
+ import useUser from '../../hooks/use-user' ;
38
36
39
37
const mainContainerStyle = { marginBottom : '100px' , marginTop : '50px' } ;
40
38
@@ -53,32 +51,31 @@ library.add(
53
51
faExternalLinkAlt ,
54
52
) ;
55
53
56
- class App extends Component {
57
- render ( ) {
58
- return (
59
- < ThemeProvider theme = { { mode : 'bubbly' } } >
60
- < div className = "App" >
61
- < link
62
- href = "https://fonts.googleapis.com/css?family=Open+Sans:700& display = swap "
63
- rel = "stylesheet"
64
- />
65
- < Navbar />
66
- < Container style = { mainContainerStyle } >
67
- < Route path = "/" exact component = { Home } />
68
- < Route path = "/about" exact component = { About } />
69
- < Route path = "/projects" exact component = { ExploreProjects } />
70
- < Route path = "/projects/:shortname" exact component = { ProjectPage } />
71
- < Route path = "/profiles" exact component = { ExploreProfiles } />
72
- < Route path = "/profile/:id" exact component = { ProfilePage } />
73
- < Route path = "/signupin" exact component = { SignUpIn } />
74
- < Route path = "/signupin/forgotpassword" exact component = { ForgotPassword } />
75
- < MessengerCustomerChat pageId = "1191043211036808" appId = "295451067827152" />
76
- </ Container >
77
- < Footer />
78
- </ div >
79
- </ ThemeProvider >
80
- ) ;
81
- }
82
- }
54
+ const App = ( ) => {
55
+ useUser ( true ) ;
56
+ return (
57
+ < ThemeProvider theme = { { mode : 'bubbly' } } >
58
+ < div className = "App" >
59
+ < link
60
+ href = "https://fonts.googleapis.com/css?family=Open+Sans:700& display = swap "
61
+ rel = "stylesheet"
62
+ />
63
+ < Navbar />
64
+ < Container style = { mainContainerStyle } >
65
+ < Route path = "/" exact component = { Home } />
66
+ < Route path = "/about" exact component = { About } />
67
+ < Route path = "/projects" exact component = { ExploreProjects } />
68
+ < Route path = "/projects/:shortname" exact component = { ProjectPage } />
69
+ < Route path = "/profiles" exact component = { ExploreProfiles } />
70
+ < Route path = "/profile/:id" exact component = { ProfilePage } />
71
+ < Route path = "/signupin" exact component = { SignUpIn } />
72
+ < Route path = "/signupin/forgotpassword" exact component = { ForgotPassword } />
73
+ < MessengerCustomerChat pageId = "1191043211036808" appId = "295451067827152" />
74
+ </ Container >
75
+ < Footer />
76
+ </ div >
77
+ </ ThemeProvider >
78
+ ) ;
79
+ } ;
83
80
84
- export default withAuthentication ( App ) ;
81
+ export default App ;
0 commit comments