-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Functional file upload and download, URL based navigation
- Loading branch information
1 parent
cf6d28c
commit da17676
Showing
34 changed files
with
687 additions
and
445 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
.background { | ||
background: var(--t-color-lightgreen); | ||
background: var(--t-color-lightgreen); | ||
} | ||
|
||
.accountInfo { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.accountName { | ||
font-weight: bold; | ||
font-weight: bold; | ||
} | ||
|
||
.project { | ||
background: var(--t-color-yellow); | ||
width: 150px; | ||
height: 150px; | ||
margin: 1em; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: var(--t-radius); | ||
color: inherit; | ||
text-decoration: none; | ||
background: var(--t-color-yellow); | ||
width: 150px; | ||
height: 150px; | ||
margin: 1em; | ||
margin-bottom: 0; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
border-radius: var(--t-radius); | ||
color: inherit; | ||
text-decoration: none; | ||
} | ||
|
||
.projects { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
align-items: center; | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
align-items: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,55 @@ | ||
import React, {Component} from 'react' | ||
import {Link} from 'react-router-dom' | ||
import React, { Component } from 'react'; | ||
import Link from './Link'; | ||
|
||
import PageContainer from './PageContainer'; | ||
import AccountIcon from './AccountIcon'; | ||
import Button from './Button' | ||
import Button from './Button'; | ||
|
||
import routes from '../constants/routes.json' | ||
|
||
import styles from './Account.css' | ||
import styles from './Account.css'; | ||
|
||
export default class Account extends Component { | ||
|
||
componentDidMount() { | ||
const account = this.props.match.params.account | ||
this.props.loadAccount(account) | ||
} | ||
|
||
render() { | ||
const {accountInfo, projects} = this.props; | ||
|
||
if(!accountInfo) return ( | ||
<PageContainer backgroundClass={styles.background}> | ||
<i className="fas fa-spinner fa-pulise"></i> | ||
</PageContainer> | ||
) | ||
|
||
const {name, image, key} = this.props.accountInfo | ||
const goToCreate = () => this.props.push(`/account/${key}/projects/new/`) | ||
|
||
const headerContent = ( | ||
<Button onClick={goToCreate}>New Project</Button> | ||
); | ||
|
||
return ( | ||
<PageContainer backgroundClass={styles.background} headerContent={headerContent}> | ||
<div className={styles.accountInfo}> | ||
<AccountIcon image={image} /> | ||
<div className={styles.accountName}>{name}</div> | ||
</div> | ||
<div className={styles.projects}> | ||
{projects.map(({key, title}) => ( | ||
<Link className={styles.project} to={`/project/${key}/view/`} key={key}>{title}</Link> | ||
))} | ||
</div> | ||
</PageContainer> | ||
) | ||
} | ||
componentDidMount() { | ||
const { account } = this.props.match.params; | ||
this.props.loadAccount(account); | ||
} | ||
|
||
render() { | ||
const { accountInfo, projects } = this.props; | ||
|
||
if (!accountInfo) | ||
return ( | ||
<PageContainer backgroundClass={styles.background} {...this.props}> | ||
<i className="fas fa-spinner fa-pulse" /> | ||
</PageContainer> | ||
); | ||
|
||
const { name, image, key } = this.props.accountInfo; | ||
const goToCreate = () => this.props.push(`/account/${key}/projects/new/`); | ||
|
||
const headerContent = <Button onClick={goToCreate}>New Project</Button>; | ||
|
||
return ( | ||
<PageContainer | ||
backgroundClass={styles.background} | ||
headerContent={headerContent} | ||
{...this.props} | ||
> | ||
<div className={styles.accountInfo}> | ||
<AccountIcon image={image} /> | ||
<div className={styles.accountName}>{name}</div> | ||
</div> | ||
<div className={styles.projects}> | ||
{projects.map(({ key, url, title }) => ( | ||
<Link | ||
className={styles.project} | ||
to={`${url}view/`} | ||
key={key} | ||
> | ||
{title} | ||
</Link> | ||
))} | ||
</div> | ||
</PageContainer> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
.accounticon { | ||
width: 3em; | ||
height: 3em; | ||
border-radius: 50%; | ||
background: magenta; | ||
align-self: center; | ||
margin-bottom: 1em; | ||
overflow: hidden; | ||
width: 3em; | ||
height: 3em; | ||
border-radius: 50%; | ||
background: magenta; | ||
align-self: center; | ||
margin-bottom: 1em; | ||
overflow: hidden; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import React from 'react' | ||
import React from 'react'; | ||
import styles from './AccountIcon.css'; | ||
|
||
export default ({image}) => { | ||
return ( | ||
<img className={styles.accounticon} src={image} /> | ||
) | ||
} | ||
export default ({ image }) => { | ||
return <img className={styles.accounticon} src={image} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
.button { | ||
padding: 0.5em; | ||
min-width: 8em; | ||
font-weight: bold; | ||
border: none; | ||
border-radius: var(--t-radius); | ||
font-size: 1.2em; | ||
padding: 0.5em; | ||
min-width: 8em; | ||
font-weight: bold; | ||
border: none; | ||
border-radius: var(--t-radius); | ||
} | ||
|
||
.big { | ||
font-size: 1.2em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
import React from 'react' | ||
import React from 'react'; | ||
|
||
import styles from './Button.css' | ||
import styles from './Button.css'; | ||
|
||
export default ({className="", children, ...props}) => ( | ||
<button className={`${styles.button} ${className}`} {...props}>{children}</button> | ||
) | ||
export default function ({ className = '', children, big, ...props }) { | ||
const classList = [styles.button] | ||
if(className) classList.push(className) | ||
if(big) classList.push(styles.big) | ||
return ( | ||
<button className={classList.join(' ')} {...props}> | ||
{children} | ||
</button> | ||
) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.