Skip to content

Commit

Permalink
Fixed up loader screen
Browse files Browse the repository at this point in the history
  • Loading branch information
RangerMauve committed May 4, 2020
1 parent 0fe0fee commit 4a4e4ed
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions app/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import LoginPage from './containers/LoginPage';
import AccountPage from './containers/AccountPage';
import ProjectViewPage from './containers/ProjectViewPage';
import NewProjectContainer from './containers/NewProjectContainer';
import LoaderPage from './components/LoaderPage';

export default () => (
<App>
Expand All @@ -18,6 +19,7 @@ export default () => (
<Route path={routes.ACCOUNT} component={AccountPage} />
<Route path={routes.PROJECT} component={ProjectViewPage} />
<Route path={routes.LOGIN} component={LoginPage} />
<Route path="/loading" component={LoaderPage} />
<Route path={routes.HOME} component={HomePage} />
</Switch>
</App>
Expand Down
6 changes: 3 additions & 3 deletions app/components/Account.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function Account({
onGoCreate,
onGoAccount
}) {
const { name, image } = accountInfo;
const { name, image, writable } = accountInfo;

const gossipedAccounts = gossiped.map(({ key, name: foundName }) => (
<Button
Expand All @@ -30,9 +30,9 @@ export default function Account({
{foundName}
</Button>
));
const newProjectButton = (
const newProjectButton = writable ? (
<Button onClick={onGoCreate}>{localization.account_new_project}</Button>
);
) : null;
const headerContent = (
<div>
{newProjectButton}
Expand Down
2 changes: 1 addition & 1 deletion app/components/Loader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';

export default function Loader() {
return <i className="fas fa-spinner fa-pulse" />;
return <i className="fas fa-spinner fa-pulse fa-10x" />;
}
8 changes: 7 additions & 1 deletion app/components/LoaderPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ import React from 'react';
import Loader from './Loader';
import PageContainer from './PageContainer';

import styles from './LoaderPage.css';

export default function LoaderPage(props) {
return (
<PageContainer {...props}>
<PageContainer
contentClass={styles.container}
backgroundClass={styles.background}
{...props}
>
<Loader />
</PageContainer>
);
Expand Down
5 changes: 3 additions & 2 deletions app/core/Account.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,14 @@ export default class Account {

async getInfo() {
const key = this.key.toString('hex');
const { writable } = this;
try {
const raw = await this.archive.readFile(ACCOUNT_INFO_FILE, 'utf8');
const parsed = JSON.parse(raw);
return { name: key, ...parsed, key };
return { name: key, ...parsed, key, writable };
} catch (e) {
console.error(e);
return { name: key, key };
return { name: key, key, writable };
}
}

Expand Down

0 comments on commit 4a4e4ed

Please sign in to comment.