Skip to content
This repository was archived by the owner on Jan 6, 2019. It is now read-only.

Logout #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { Route, Redirect, withRouter, Switch } from 'react-router-dom'
import Async from 'react-code-splitting'

import Login from './Auth/Login'
import Signup from './Auth/Signup'
import Header from './Header'
Expand Down
3 changes: 2 additions & 1 deletion src/components/Header/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react'

import { Title } from '../Styled'
import { Title, Head } from '../Styled'
import Github from './Github'

const Header = () => (
<div>
<Head />
<Title>redux-react-starter</Title>
<Github />
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/components/Home.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import PropTypes from 'prop-types'
// import { Link } from 'react-router-dom'
import { connect } from 'react-redux'
import { Redirect } from 'react-router-dom'

Expand All @@ -10,6 +11,9 @@ const Home = ({ user }) =>
<Message>
{"You're logged in as "}
<Blue>{user.email}</Blue>
<a href="/login">
<button onClick={localStorage.clear()}>logout</button>
</a>
</Message>
) : (
<Redirect to="/login" />
Expand Down
7 changes: 7 additions & 0 deletions src/components/Styled.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ export const Body = styled.div`
text-align: center;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
`
export const Head = styled.div`
border: none;
background-color: #3a7bd5;
height: 65px;
width: 100%;
z-index: 20;
`

export const Title = styled.h1`
font-family: sans-serif;
Expand Down
Loading