Merge branch 'feature/update-topbar'
This commit is contained in:
commit
5cc6506ebd
9 files changed
+85
-96
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import Typography from '@material-ui/core/Typography'
|
||||
|
||||
const BannerTopBar = ({
|
||||
size,
|
||||
backgroundUrl,
|
||||
title,
|
||||
text
|
||||
}) => (
|
||||
<div className={`bannerTopBar ${size}`} style={backgroundUrl ? { backgroundImage: `url(${backgroundUrl})` } : {}}>
|
||||
<div className='caption'>
|
||||
<Typography className='title' variant='h1' align='center'>{title}</Typography>
|
||||
<Typography className='text' variant='h2' align='center'>{text}</Typography>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
BannerTopBar.propTypes = {
|
||||
backgroundUrl: PropTypes.string,
|
||||
size: PropTypes.string,
|
||||
title: PropTypes.string,
|
||||
text: PropTypes.string
|
||||
}
|
||||
|
||||
export default BannerTopBar
|
||||
@@ -1,50 +0,0 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
import { Typography } from '@material-ui/core'
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
|
||||
import styles from './TopBarStyles'
|
||||
|
||||
class TopBar extends React.Component {
|
||||
render () {
|
||||
const {
|
||||
classes,
|
||||
size,
|
||||
title,
|
||||
text
|
||||
} = this.props
|
||||
if (size === 'big') {
|
||||
return (
|
||||
<div className={classes.rootBig}>
|
||||
<div className={classes.captions}>
|
||||
<Typography className={classes.title} variant='h5' align='center'>{title}</Typography>
|
||||
<Typography className={classes.text} variant='subtitle1' align='center'>{text}</Typography>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
if (size === 'medium') {
|
||||
return (
|
||||
<div className={classes.rootMedium}>
|
||||
<div className={classes.captions}>
|
||||
<Typography className={classes.title} variant='h5' align='center'>{title}</Typography>
|
||||
<Typography className={classes.text} variant='subtitle1' align='center'>{text}</Typography>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<div className={classes.rootSmall} />
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
TopBar.propTypes = {
|
||||
classes: PropTypes.object.isRequired,
|
||||
size: PropTypes.string,
|
||||
title: PropTypes.string,
|
||||
text: PropTypes.string
|
||||
}
|
||||
|
||||
export default withStyles(styles)(TopBar)
|
||||
@@ -1,4 +1,4 @@
|
||||
import TeamBar from './components/TeamBar'
|
||||
import TopBar from './components/TopBar'
|
||||
import BannerTopBar from './components/BannerTopBar'
|
||||
|
||||
export { TeamBar, TopBar }
|
||||
export { TeamBar, BannerTopBar }
|
||||
@@ -3,6 +3,8 @@ import PropTypes from 'prop-types'
|
||||
import { Query } from 'react-apollo'
|
||||
|
||||
import Grid from '@material-ui/core/Grid'
|
||||
import Paper from '@material-ui/core/Paper'
|
||||
import Typography from '@material-ui/core/Typography'
|
||||
import { MessageCard } from '@advancedalgos/web-components'
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
|
||||
@@ -61,36 +63,49 @@ export const ManageFBList = ({ classes }) => (
|
||||
if (!loading && !error) {
|
||||
if (data.teams_TeamsByOwner.length > 0) {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Grid container spacing={40}>
|
||||
{!loading &&
|
||||
data.teams_TeamsByOwner.map(team => (
|
||||
<ManageFBItem
|
||||
key={team.id}
|
||||
team={team}
|
||||
classes={classes}
|
||||
/>
|
||||
))}
|
||||
{errors}
|
||||
</Grid>
|
||||
</React.Fragment>
|
||||
<Grid container spacing={0} direction='column' justify='center' alignItems='center'>
|
||||
{!loading &&
|
||||
data.teams_TeamsByOwner.map(team => (
|
||||
<ManageFBItem
|
||||
key={team.id}
|
||||
team={team}
|
||||
classes={classes}
|
||||
/>
|
||||
))}
|
||||
{errors}
|
||||
</Grid>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<Grid container spacing={40}>
|
||||
<Grid item xs={12}>
|
||||
<MessageCard message='No financial beings yet — Create a team first!' />
|
||||
{errors !== null && <MessageCard message={errors} />}
|
||||
<Paper>
|
||||
<Grid container spacing={0} direction='column' justify='center' alignItems='center' className={classes.container}>
|
||||
<Grid item xs={10}>
|
||||
<Typography variant='h5' align='center'>
|
||||
You don’t have any financial being. To create one, create a team first!
|
||||
</Typography>
|
||||
<Typography variant='body2' align='center' gutterBottom>
|
||||
After you create a team, a default trading algobot will be cloned and added to your team so
|
||||
that you can begin experimenting right away.
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Paper>
|
||||
)
|
||||
}
|
||||
} else {
|
||||
return (
|
||||
<Grid container spacing={40}>
|
||||
<Grid spacing={0} direction='column' justify='center' alignItems='center'>
|
||||
<Grid item xs={12}>
|
||||
<MessageCard message='Loading...' />
|
||||
{errors !== null && <MessageCard message={errors} />}
|
||||
{errors === null &&
|
||||
<Typography variant='h5' align='center' gutterBottom>
|
||||
Loading...
|
||||
</Typography>
|
||||
}
|
||||
{errors !== null &&
|
||||
<Typography variant='h5' align='center' gutterBottom>
|
||||
{errors}
|
||||
</Typography>
|
||||
}
|
||||
</Grid>
|
||||
</Grid>
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
|
||||
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
|
||||
import { TopBar } from '../common'
|
||||
import { BannerTopBar } from '../common'
|
||||
import ManageFBList from './components/ManageFBList'
|
||||
|
||||
const styles = theme => ({
|
||||
@@ -14,7 +14,7 @@ const styles = theme => ({
|
||||
|
||||
const FinancialBeings = ({ classes }) => (
|
||||
<div>
|
||||
<TopBar size='medium' title='Manage Your Financial Beings' text='Manage your Advanced Algos Financial Beings' />
|
||||
<BannerTopBar size='medium' title='Manage Your Financial Beings' text='Manage your Advanced Algos Financial Beings' backgroundUrl='https://advancedalgos.net/img/photos/teams.jpg' />
|
||||
<ManageFBList />
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -68,20 +68,18 @@ export const ManageTeamsList = ({ classes, user = null, ...props }) => (
|
||||
if (!loading && !error) {
|
||||
if (data.teams_TeamsByOwner.length > 0) {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Grid container spacing={0} direction='column' justify='center' alignItems='center'>
|
||||
{!loading &&
|
||||
data.teams_TeamsByOwner.map(team => (
|
||||
<ManageTeamsItem
|
||||
key={team.id}
|
||||
team={team}
|
||||
classes={classes}
|
||||
{...props}
|
||||
/>
|
||||
))}
|
||||
{errors}
|
||||
</Grid>
|
||||
</React.Fragment>
|
||||
<Grid container spacing={0} direction='column' justify='center' alignItems='center'>
|
||||
{!loading &&
|
||||
data.teams_TeamsByOwner.map(team => (
|
||||
<ManageTeamsItem
|
||||
key={team.id}
|
||||
team={team}
|
||||
classes={classes}
|
||||
{...props}
|
||||
/>
|
||||
))}
|
||||
{errors}
|
||||
</Grid>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
@@ -94,7 +92,7 @@ export const ManageTeamsList = ({ classes, user = null, ...props }) => (
|
||||
<Typography variant='body2' align='center' gutterBottom>
|
||||
To begin developing on the Advanced Algos platform, as well as participate in Algobot competitions,
|
||||
you'll need to create a team. A default trading algobot will be cloned and added to your team so
|
||||
that you can begin experimenting right away..
|
||||
that you can begin experimenting right away.
|
||||
</Typography>
|
||||
<CreateTeamForm />
|
||||
</Grid>
|
||||
|
||||
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types'
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
import Grid from '@material-ui/core/Grid'
|
||||
|
||||
import { TopBar } from '../common'
|
||||
import { BannerTopBar } from '../common'
|
||||
import ManageTeamsList from './components/ManageTeamsList'
|
||||
|
||||
const styles = theme => ({
|
||||
@@ -24,7 +24,7 @@ const styles = theme => ({
|
||||
|
||||
const ManageTeams = ({ classes, ...props }) => (
|
||||
<div>
|
||||
<TopBar size='medium' title='Manage Your Teams' text='Create and manage your Advanced Algos teams' />
|
||||
<BannerTopBar size='medium' title='Manage Your Teams' text='Create and manage your Advanced Algos teams' backgroundUrl='https://advancedalgos.net/img/photos/teams.jpg' />
|
||||
<Grid
|
||||
container
|
||||
direction='column'
|
||||
|
||||
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types'
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
|
||||
// import ManageTeamMembersList from './components/ManageTeamMembersList'
|
||||
import { TopBar } from '../common'
|
||||
import { BannerTopBar } from '../common'
|
||||
|
||||
const styles = theme => ({
|
||||
tableContainer: {
|
||||
@@ -14,7 +14,7 @@ const styles = theme => ({
|
||||
|
||||
const TeamMembers = ({ classes }) => (
|
||||
<div>
|
||||
<TopBar size='big' title='Team Members' text='Coming soon. Invite and manage team members.' />
|
||||
<BannerTopBar size='big' title='Team Members' text='Coming soon. Invite and manage team members.' backgroundUrl='https://advancedalgos.net/img/photos/teams.jpg' />
|
||||
</div>
|
||||
)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
|
||||
|
||||
import { withStyles } from '@material-ui/core/styles'
|
||||
|
||||
import { TopBar } from '../common'
|
||||
import { BannerTopBar } from '../common'
|
||||
import TeamsList from './components/TeamsList'
|
||||
|
||||
const styles = theme => ({
|
||||
@@ -31,7 +31,7 @@ const styles = theme => ({
|
||||
|
||||
const Teams = ({ classes, match }) => (
|
||||
<React.Fragment>
|
||||
<TopBar size='medium' title='Browse Teams' text='Explore Advanced Algos Teams' />
|
||||
<BannerTopBar size='medium' title='Browse Teams' text='Explore Advanced Algos Teams' backgroundUrl='https://advancedalgos.net/img/photos/teams.jpg' />
|
||||
<main className={classes.layout}>
|
||||
<TeamsList match={match} />
|
||||
</main>
|
||||
|
||||
Reference in new issue
Block a user