--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { createMuiTheme } from '@material-ui/core/styles';
+import { ThemeOptions, Theme } from '@material-ui/core/styles/createMuiTheme';
+import purple from '@material-ui/core/colors/purple';
+import blue from '@material-ui/core/colors/blue';
+import grey from '@material-ui/core/colors/grey';
+
+interface ArvadosThemeOptions extends ThemeOptions {
+ customs: any;
+}
+
+export interface ArvadosTheme extends Theme {
+ customs: any;
+}
+
+const purple900 = purple["900"];
+const grey600 = grey["600"];
+const themeOptions: ArvadosThemeOptions = {
+ customs: {
+ colors: {
+
+ }
+ },
+ overrides: {
+ MuiAppBar: {
+ colorPrimary: {
+ backgroundColor: purple900
+ }
+ },
+ MuiTabs: {
+ root: {
+ color: grey600
+ },
+ indicator: {
+ backgroundColor: purple900
+ }
+ },
+ MuiTab: {
+ selected: {
+ fontWeight: 700,
+ color: purple900
+ }
+ }
+ },
+ mixins: {
+ toolbar: {
+ minHeight: '48px'
+ }
+ },
+ palette: {
+ primary: {
+ main: '#06C',
+ dark: blue.A100
+ }
+ }
+};
+
+export const CustomTheme = createMuiTheme(themeOptions);
\ No newline at end of file
import authActions from "./store/auth/auth-action";
import { authService } from "./services/services";
import { getProjectList } from "./store/project/project-action";
+import { MuiThemeProvider } from '@material-ui/core/styles';
+import { CustomTheme } from './common/custom-theme';
const history = createBrowserHistory();
store.dispatch<any>(getProjectList(rootUuid));
const App = () =>
- <Provider store={store}>
- <ConnectedRouter history={history}>
- <div>
- <Route path="/" component={Workbench}/>
- <Route path="/token" component={ApiToken}/>
- </div>
- </ConnectedRouter>
- </Provider>;
+ <MuiThemeProvider theme={CustomTheme}>
+ <Provider store={store}>
+ <ConnectedRouter history={history}>
+ <div>
+ <Route path="/" component={Workbench}/>
+ <Route path="/token" component={ApiToken}/>
+ </div>
+ </ConnectedRouter>
+ </Provider>
+ </MuiThemeProvider>;
ReactDOM.render(
<App/>,
import Drawer from '@material-ui/core/Drawer';
import IconButton from "@material-ui/core/IconButton";
import CloseIcon from '@material-ui/icons/Close';
-import { StyleRulesCallback, WithStyles, withStyles, Theme } from "@material-ui/core/styles";
+import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
+import { ArvadosTheme } from '../../common/custom-theme';
import Tabs from '@material-ui/core/Tabs';
import Tab from '@material-ui/core/Tab';
import Typography from '@material-ui/core/Typography';
import * as classnames from "classnames";
export interface DetailsPanelProps {
- closeDrawer: () => void;
+ onCloseDrawer: () => void;
isOpened: boolean;
}
this.setState({ tabsValue: value });
}
- renderTabContainer = (children: React.ReactElement<any>) => {
- return (
- <Typography className={this.props.classes.tabContainer} component="div">
- {children}
- </Typography>
- );
- }
+ renderTabContainer = (children: React.ReactElement<any>) =>
+ <Typography className={this.props.classes.tabContainer} component="div">
+ {children}
+ </Typography>
render() {
- const { classes, closeDrawer, isOpened } = this.props;
+ const { classes, onCloseDrawer, isOpened } = this.props;
const { tabsValue } = this.state;
return (
<div className={classnames([classes.container, { [classes.opened]: isOpened }])}>
<Typography variant="title">
Tutorial pipeline
</Typography>
- <IconButton color="inherit" onClick={closeDrawer}>
+ <IconButton color="inherit" onClick={onCloseDrawer}>
<CloseIcon />
</IconButton>
</Grid>
</Typography>
- <Tabs value={tabsValue} onChange={this.handleChange}
- classes={{ indicator: classes.tabsIndicator }}>
- <Tab
- disableRipple
- classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
- label="Details" />
- <Tab
- disableRipple
- classes={{ root: classes.tabRoot, selected: classes.tabSelected }}
- label="Activity" />
+ <Tabs value={tabsValue} onChange={this.handleChange}>
+ <Tab disableRipple label="Details" />
+ <Tab disableRipple label="Activity" />
</Tabs>
{tabsValue === 0 && this.renderTabContainer(
<Grid container>
}
type CssRules = 'drawerPaper' | 'container' | 'opened' | 'headerContainer'
- | 'tabsIndicator' | 'tabRoot' | 'tabContainer' | 'tabSelected' | 'gridLabel';
+ | 'tabContainer' | 'tabSelected' | 'gridLabel';
const drawerWidth = 320;
-const colorPurple = '#692498';
-const colorLightGray = '#A1A1A1';
-const colorVeryLightGray = '#999999';
-const colorGray = '#333';
-
-const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
container: {
width: 0,
position: 'relative',
width: drawerWidth
},
headerContainer: {
- color: colorLightGray,
+ color: theme.palette.grey["600"],
margin: `${theme.spacing.unit}px 0`
},
- tabsIndicator: {
- backgroundColor: colorPurple
- },
- tabRoot: {
- color: colorGray,
- '&$tabSelected': {
- fontWeight: 700,
- color: colorPurple
- }
- },
tabContainer: {
padding: theme.spacing.unit * 3
},
tabSelected: {},
gridLabel: {
- color: colorVeryLightGray,
+ color: theme.palette.grey["500"]
}
});
// SPDX-License-Identifier: AGPL-3.0
import * as React from "react";
-import { AppBar, Toolbar, Typography, Grid, IconButton, Badge, StyleRulesCallback, withStyles, WithStyles, Button, MenuItem } from "@material-ui/core";
+import { AppBar, Toolbar, Typography, Grid, IconButton, Badge, Button, MenuItem } from "@material-ui/core";
import NotificationsIcon from "@material-ui/icons/Notifications";
import PersonIcon from "@material-ui/icons/Person";
import HelpIcon from "@material-ui/icons/Help";
onDetailsPanelToggle: () => void;
}
-type MainAppBarProps = MainAppBarDataProps & MainAppBarActionProps & WithStyles<CssRules>;
+type MainAppBarProps = MainAppBarDataProps & MainAppBarActionProps;
export const MainAppBar: React.SFC<MainAppBarProps> = (props) => {
- return <AppBar className={props.classes.appBar} position="static">
- <Toolbar className={props.classes.toolbar}>
- <Grid
- container
- justify="space-between"
- >
+ return <AppBar position="static">
+ <Toolbar>
+ <Grid container justify="space-between">
<Grid item xs={3}>
<Typography variant="headline" color="inherit" noWrap>
Arvados
));
};
-type CssRules = "appBar" | "toolbar";
-
-const styles: StyleRulesCallback<CssRules> = theme => ({
- appBar: {
- backgroundColor: "#692498"
- },
- toolbar: {
- minHeight: '48px'
- }
-});
-
-export default withStyles(styles)(MainAppBar);
+export default MainAppBar;
// SPDX-License-Identifier: AGPL-3.0
import * as React from 'react';
-import { StyleRulesCallback, Theme, WithStyles, withStyles } from '@material-ui/core/styles';
+import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
import Drawer from '@material-ui/core/Drawer';
import { connect, DispatchProp } from "react-redux";
import { Route, Switch, RouteComponentProps, withRouter } from "react-router";
import ProjectPanel from "../project-panel/project-panel";
import { sidePanelData } from '../../store/side-panel/side-panel-reducer';
import DetailsPanel from '../../views-components/details-panel/details-panel';
+import { ArvadosTheme } from '../../common/custom-theme';
const drawerWidth = 240;
-const appBarHeight = 116;
+const appBarHeight = 100;
type CssRules = 'root' | 'appBar' | 'drawerPaper' | 'content' | 'contentWrapper' | 'toolbar';
-const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
root: {
flexGrow: 1,
zIndex: 1,
},
appBar: {
zIndex: theme.zIndex.drawer + 1,
- backgroundColor: '#692498',
position: "absolute",
width: "100%"
},
paddingTop: appBarHeight
},
content: {
- padding: theme.spacing.unit * 3,
+ padding: `${theme.spacing.unit}px ${theme.spacing.unit * 3}px`,
overflowY: "auto",
flexGrow: 1
},
</div>
<DetailsPanel
isOpened={this.state.isDetailsPanelOpened}
- closeDrawer={this.mainAppBarActions.onDetailsPanelToggle} />
+ onCloseDrawer={this.mainAppBarActions.onDetailsPanelToggle} />
</main>
</div>
);