mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
initial styling
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import React, { Component } from "react";
|
||||
import Navigation from "./Navigation";
|
||||
import Main from "./Main";
|
||||
import Login from "./Login";
|
||||
import { getIsAuthenticated } from "../modules/login";
|
||||
import { connect } from "react-redux";
|
||||
import { withRouter } from "react-router-dom";
|
||||
|
||||
import "./App.css";
|
||||
import Header from "../components/Header";
|
||||
import PrimaryNavigation from "../components/PrimaryNavigation";
|
||||
|
||||
type Props = {
|
||||
login: boolean,
|
||||
username: string,
|
||||
@@ -18,24 +21,26 @@ class App extends Component<Props> {
|
||||
this.props.getAuthState();
|
||||
}
|
||||
render() {
|
||||
const { login, username, loading } = this.props;
|
||||
const { login, loading } = this.props;
|
||||
|
||||
let content;
|
||||
let navigation;
|
||||
|
||||
if (loading) {
|
||||
return <div>Loading...</div>;
|
||||
content = <div>Loading...</div>;
|
||||
} else if (!login) {
|
||||
return (
|
||||
<div>
|
||||
<Login />
|
||||
</div>
|
||||
);
|
||||
content = <Login />;
|
||||
} else {
|
||||
return (
|
||||
<div className="App">
|
||||
<h2>Welcome, {username}!</h2>
|
||||
<Navigation />
|
||||
<Main />
|
||||
</div>
|
||||
);
|
||||
content = <Main />;
|
||||
navigation = <PrimaryNavigation />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="App">
|
||||
<Header>{navigation}</Header>
|
||||
{content}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user