renaming: loading to login

This commit is contained in:
Maren Süwer
2018-07-02 16:22:24 +02:00
parent e087920ba5
commit 69a081ccf8
5 changed files with 16 additions and 16 deletions

View File

@@ -8,7 +8,7 @@ const styles = {
display: 'flex', display: 'flex',
height: '10em' height: '10em'
}, },
loading: { login: {
margin: 'auto', margin: 'auto',
textAlign: 'center' textAlign: 'center'
} }
@@ -24,7 +24,7 @@ class Login extends React.Component<Props> {
const { classes } = this.props; const { classes } = this.props;
return ( return (
<div className={classes.wrapper}> <div className={classes.wrapper}>
<div className={classes.loading}> <div className={classes.login}>
You need to log in! ... You need to log in! ...
</div> </div>
</div> </div>

View File

@@ -7,7 +7,7 @@ import Login from '../Login';
type Props = { type Props = {
loading: boolean, login: boolean,
error: any, error: any,
repositories: any, repositories: any,
fetchRepositoriesIfNeeded: () => void fetchRepositoriesIfNeeded: () => void
@@ -20,10 +20,10 @@ class Page extends React.Component<Props> {
} }
render() { render() {
const { loading, error, repositories } = this.props; const { login, error, repositories } = this.props;
if(loading) { if(login) {
return ( return (
<div> <div>
<h1>SCM</h1> <h1>SCM</h1>
@@ -31,7 +31,7 @@ class Page extends React.Component<Props> {
</div> </div>
); );
} }
else if(!loading){ else if(!login){
return ( return (
<div> <div>
<h1>SCM</h1> <h1>SCM</h1>

View File

@@ -6,7 +6,7 @@ import { fetchRepositoriesIfNeeded } from '../modules/users';
import Login from '../Login'; import Login from '../Login';
type Props = { type Props = {
loading: boolean, login: boolean,
error: any, error: any,
repositories: any, repositories: any,
fetchRepositoriesIfNeeded: () => void fetchRepositoriesIfNeeded: () => void
@@ -19,11 +19,11 @@ class Users extends React.Component<Props> {
} }
render() { render() {
const { loading, error, repositories } = this.props; const { login, error, repositories } = this.props;
if(loading) { if(login) {
return ( return (
<div> <div>
<h1>SCM</h1> <h1>SCM</h1>
@@ -31,7 +31,7 @@ class Users extends React.Component<Props> {
</div> </div>
); );
} }
else if(!loading){ else if(!login){
return ( return (
<div> <div>
<h1>SCM</h1> <h1>SCM</h1>

View File

@@ -37,13 +37,13 @@ export default function reducer(state = {}, action = {}) {
case FETCH_REPOSITORIES: case FETCH_REPOSITORIES:
return { return {
...state, ...state,
loading: true, login: true,
error: null error: null
}; };
case FETCH_REPOSITORIES_SUCCESS: case FETCH_REPOSITORIES_SUCCESS:
return { return {
...state, ...state,
loading: true, login: true,
timestamp: action.timestamp, timestamp: action.timestamp,
error: null, error: null,
repositories: action.payload repositories: action.payload
@@ -51,7 +51,7 @@ export default function reducer(state = {}, action = {}) {
case FETCH_REPOSITORIES_FAILURE: case FETCH_REPOSITORIES_FAILURE:
return { return {
...state, ...state,
loading: true, login: true,
error: action.payload error: action.payload
}; };

View File

@@ -37,13 +37,13 @@ export default function reducer(state = {}, action = {}) {
case FETCH_REPOSITORIES: case FETCH_REPOSITORIES:
return { return {
...state, ...state,
loading: true, login: true,
error: null error: null
}; };
case FETCH_REPOSITORIES_SUCCESS: case FETCH_REPOSITORIES_SUCCESS:
return { return {
...state, ...state,
loading: false, login: false,
timestamp: action.timestamp, timestamp: action.timestamp,
error: null, error: null,
repositories: action.payload repositories: action.payload
@@ -51,7 +51,7 @@ export default function reducer(state = {}, action = {}) {
case FETCH_REPOSITORIES_FAILURE: case FETCH_REPOSITORIES_FAILURE:
return { return {
...state, ...state,
loading: false, login: false,
error: action.payload error: action.payload
}; };