From 45301ca7f5180e307ca041683f3f6409e8733c50 Mon Sep 17 00:00:00 2001 From: Barry Low Date: Fri, 9 Nov 2018 08:36:41 -0800 Subject: [PATCH] Update TopBar to BannerTopBar --- .../views/common/components/BannerTopBar.js | 26 +++++++++ client/src/views/common/components/TopBar.js | 50 ---------------- client/src/views/common/index.js | 4 +- .../components/ManageFBList.js | 57 ++++++++++++------- client/src/views/financial-beings/index.js | 4 +- .../components/ManageTeamsList.js | 28 +++++---- client/src/views/manage-teams/index.js | 4 +- client/src/views/team-members/index.js | 4 +- client/src/views/teams/index.js | 4 +- 9 files changed, 85 insertions(+), 96 deletions(-) create mode 100644 client/src/views/common/components/BannerTopBar.js delete mode 100644 client/src/views/common/components/TopBar.js diff --git a/client/src/views/common/components/BannerTopBar.js b/client/src/views/common/components/BannerTopBar.js new file mode 100644 index 000000000..866cbfe2a --- /dev/null +++ b/client/src/views/common/components/BannerTopBar.js @@ -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 +}) => ( +
+
+ {title} + {text} +
+
+) + +BannerTopBar.propTypes = { + backgroundUrl: PropTypes.string, + size: PropTypes.string, + title: PropTypes.string, + text: PropTypes.string +} + +export default BannerTopBar diff --git a/client/src/views/common/components/TopBar.js b/client/src/views/common/components/TopBar.js deleted file mode 100644 index c7320b1f8..000000000 --- a/client/src/views/common/components/TopBar.js +++ /dev/null @@ -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 ( -
-
- {title} - {text} -
-
- ) - } - if (size === 'medium') { - return ( -
-
- {title} - {text} -
-
- ) - } - return ( -
- ) - } -} - -TopBar.propTypes = { - classes: PropTypes.object.isRequired, - size: PropTypes.string, - title: PropTypes.string, - text: PropTypes.string -} - -export default withStyles(styles)(TopBar) diff --git a/client/src/views/common/index.js b/client/src/views/common/index.js index 113554cae..cc64107b2 100644 --- a/client/src/views/common/index.js +++ b/client/src/views/common/index.js @@ -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 } diff --git a/client/src/views/financial-beings/components/ManageFBList.js b/client/src/views/financial-beings/components/ManageFBList.js index 026385831..9893f4812 100644 --- a/client/src/views/financial-beings/components/ManageFBList.js +++ b/client/src/views/financial-beings/components/ManageFBList.js @@ -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 ( - - - {!loading && - data.teams_TeamsByOwner.map(team => ( - - ))} - {errors} - - + + {!loading && + data.teams_TeamsByOwner.map(team => ( + + ))} + {errors} + ) } else { return ( - - - - {errors !== null && } + + + + + You don’t have any financial being. To create one, create a team first! + + + 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. + + - + ) } } else { return ( - + - - {errors !== null && } + {errors === null && + + Loading... + + } + {errors !== null && + + {errors} + + } ) diff --git a/client/src/views/financial-beings/index.js b/client/src/views/financial-beings/index.js index e23c46ce4..a3cf773ad 100644 --- a/client/src/views/financial-beings/index.js +++ b/client/src/views/financial-beings/index.js @@ -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 }) => (
- +
) diff --git a/client/src/views/manage-teams/components/ManageTeamsList.js b/client/src/views/manage-teams/components/ManageTeamsList.js index 74bc3fb3e..0717dda7f 100644 --- a/client/src/views/manage-teams/components/ManageTeamsList.js +++ b/client/src/views/manage-teams/components/ManageTeamsList.js @@ -68,20 +68,18 @@ export const ManageTeamsList = ({ classes, user = null, ...props }) => ( if (!loading && !error) { if (data.teams_TeamsByOwner.length > 0) { return ( - - - {!loading && - data.teams_TeamsByOwner.map(team => ( - - ))} - {errors} - - + + {!loading && + data.teams_TeamsByOwner.map(team => ( + + ))} + {errors} + ) } else { return ( @@ -94,7 +92,7 @@ export const ManageTeamsList = ({ classes, user = null, ...props }) => ( 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.
diff --git a/client/src/views/manage-teams/index.js b/client/src/views/manage-teams/index.js index b70be5273..1e5a72f92 100644 --- a/client/src/views/manage-teams/index.js +++ b/client/src/views/manage-teams/index.js @@ -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 }) => (
- + ({ tableContainer: { @@ -14,7 +14,7 @@ const styles = theme => ({ const TeamMembers = ({ classes }) => (
- +
) diff --git a/client/src/views/teams/index.js b/client/src/views/teams/index.js index 07034a796..9d6b4fa9d 100644 --- a/client/src/views/teams/index.js +++ b/client/src/views/teams/index.js @@ -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 }) => ( - +