Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
toiletcoin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
atichat
toiletcoin
Commits
ee01d354
Commit
ee01d354
authored
Aug 01, 2019
by
OuiAtichat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Navbarcomponent
parent
f467c56e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
9 deletions
+51
-9
src/Pages/Home.js
+22
-7
src/Pages/LogIn/LogInView.js
+1
-1
src/components/NavBar.js
+23
-0
src/index.js
+1
-1
src/styles.scss
+4
-0
No files found.
src/Pages/Home.js
View file @
ee01d354
import
React
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
app
from
'../firebase'
;
import
{
Row
,
Col
,
Container
}
from
'react-bootstrap'
;
import
DataTable
from
'../components/DataTable'
;
import
NavBar
from
'../components/NavBar'
;
// mock component
const
Map
=
()
=>
<
Col
>
Map
<
/Col>
;
...
...
@@ -10,14 +11,26 @@ const RevenueChart = () => <Col>Revenue chart</Col>;
const
PeopleChart
=
()
=>
<
Col
>
People
chart
<
/Col>
;
const
RemoteChart
=
()
=>
<
Col
>
Remote
chart
<
/Col>
;
c
onst
Home
=
()
=>
{
const
signOut
=
async
()
=>
{
await
app
.
auth
().
signOut
();
c
lass
Home
extends
Component
{
state
=
{
currentUser
:
null
,
};
componentDidMount
()
{
this
.
getCurrentUser
();
}
getCurrentUser
=
async
()
=>
{
const
{
displayName
,
email
}
=
await
app
.
auth
().
currentUser
;
this
.
setState
({
currentUser
:
displayName
||
email
});
};
render
()
{
const
{
currentUser
}
=
this
.
state
;
return
(
<>
<
NavBar
user
=
{
currentUser
}
/
>
<
Container
>
<
h1
>
Home
<
/h1
>
<
button
onClick
=
{
signOut
}
>
signOut
<
/button
>
<
Row
>
<
Map
/>
<
/Row
>
...
...
@@ -33,7 +46,9 @@ const Home = () => {
<
DataTable
/>
<
/Row
>
<
/Container
>
<
/
>
);
};
}
}
export
default
Home
;
src/Pages/LogIn/LogInView.js
View file @
ee01d354
import
React
from
'react'
;
import
{
Card
,
Form
,
Button
,
Container
,
Row
}
from
'react-bootstrap'
;
import
{
Card
,
Form
,
Button
,
Container
}
from
'react-bootstrap'
;
const
LogInView
=
({
onSubmit
})
=>
{
return
(
<
Container
style
=
{{
alignItems
:
'center'
,
paddingTop
:
'2em'
,
maxWidth
:
'400px'
}}
>
...
...
src/components/NavBar.js
0 → 100644
View file @
ee01d354
import
React
from
'react'
;
import
{
Navbar
,
Button
}
from
'react-bootstrap'
;
import
app
from
'../firebase'
;
const
NavbarComponent
=
({
user
})
=>
{
const
signOut
=
async
()
=>
{
await
app
.
auth
().
signOut
();
};
return
(
<
Navbar
style
=
{{
backgroundColor
:
'#49b9ff'
}}
>
<
Navbar
.
Brand
style
=
{{
color
:
'#fff'
}}
>
ToiletCoin
Dashboard
<
/Navbar.Brand
>
<
Navbar
.
Toggle
/>
<
Navbar
.
Collapse
className
=
"justify-content-end"
>
<
Navbar
.
Text
style
=
{{
color
:
'#fff'
}}
>
user
:
{
user
}
<
/Navbar.Text
>
<
Button
variant
=
"link"
onClick
=
{
signOut
}
style
=
{{
color
:
'#fff'
}}
>
Log
Out
<
/Button
>
<
/Navbar.Collapse
>
<
/Navbar
>
);
};
export
default
NavbarComponent
;
src/index.js
View file @
ee01d354
...
...
@@ -6,4 +6,4 @@ import './styles.scss';
ReactDOM
.
render
(
<
App
/>
,
document
.
getElementById
(
'root'
));
serviceWorker
.
un
register
();
serviceWorker
.
register
();
src/styles.scss
View file @
ee01d354
// Override default variables before the import
// $body-bg: #000;
.body
{
background
:
linear-gradient
(
45deg
,
#f7f7f7
,
#e3e3e3
);
}
// Import Bootstrap and its default variables
@import
'~bootstrap/scss/bootstrap.scss'
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment