Skip to content
Snippets Groups Projects
Commit a1519cc7 authored by vkovtun's avatar vkovtun
Browse files

SSDM-13579: New toolbar buttons layout and style.

parent f9909fe3
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -7,7 +7,6 @@ import DescriptionIcon from '@material-ui/icons/DescriptionOutlined' ...@@ -7,7 +7,6 @@ import DescriptionIcon from '@material-ui/icons/DescriptionOutlined'
import AudioIcon from '@material-ui/icons/MusicNoteOutlined' import AudioIcon from '@material-ui/icons/MusicNoteOutlined'
import VideoIcon from '@material-ui/icons/LocalMovies' import VideoIcon from '@material-ui/icons/LocalMovies'
import ImageIcon from '@material-ui/icons/Image' import ImageIcon from '@material-ui/icons/Image'
import Paper from '@material-ui/core/Paper'
import Grid from '@src/js/components/common/grid/Grid.jsx' import Grid from '@src/js/components/common/grid/Grid.jsx'
import GridFilterOptions from '@src/js/components/common/grid/GridFilterOptions.js' import GridFilterOptions from '@src/js/components/common/grid/GridFilterOptions.js'
import AppController from '@src/js/components/AppController.js' import AppController from '@src/js/components/AppController.js'
...@@ -20,7 +19,7 @@ const styles = theme => ({ ...@@ -20,7 +19,7 @@ const styles = theme => ({
columnFlexContainer: { columnFlexContainer: {
flexDirection: 'column', flexDirection: 'column',
display: 'flex', display: 'flex',
height: '100vh' height: 'calc(100vh - ' + theme.spacing(10) + 'px)'
}, },
boundary: { boundary: {
padding: theme.spacing(1), padding: theme.spacing(1),
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
import React from 'react' import React from 'react'
import { withStyles } from '@material-ui/core/styles' import { withStyles } from '@material-ui/core/styles'
import messages from '@src/js/common/messages.js' import messages from '@src/js/common/messages.js'
import Button from '@src/js/components/common/form/Button.jsx'
import ViewComfyIcon from '@material-ui/icons/ViewComfy' import ViewComfyIcon from '@material-ui/icons/ViewComfy'
import ViewListIcon from '@material-ui/icons/ViewList' import ViewListIcon from '@material-ui/icons/ViewList'
import PublishIcon from '@material-ui/icons/Publish' import PublishIcon from '@material-ui/icons/Publish'
...@@ -28,6 +27,9 @@ import InfoIcon from '@material-ui/icons/InfoOutlined' ...@@ -28,6 +27,9 @@ import InfoIcon from '@material-ui/icons/InfoOutlined'
import CreateNewFolderIcon from '@material-ui/icons/CreateNewFolderOutlined' import CreateNewFolderIcon from '@material-ui/icons/CreateNewFolderOutlined'
import autoBind from 'auto-bind' import autoBind from 'auto-bind'
import { ToggleButton } from '@material-ui/lab' import { ToggleButton } from '@material-ui/lab'
import Button from '@material-ui/core/Button'
const color = 'secondary'
const styles = (theme) => ({ const styles = (theme) => ({
buttons: { buttons: {
...@@ -38,6 +40,13 @@ const styles = (theme) => ({ ...@@ -38,6 +40,13 @@ const styles = (theme) => ({
'& button': { '& button': {
marginRight: theme.spacing(1) marginRight: theme.spacing(1)
} }
},
toggleButton: {
marginRight: theme.spacing(1),
border: '1px solid ' + theme.palette[color].main,
'& *': {
color: theme.palette[color].main
}
} }
}) })
...@@ -51,50 +60,78 @@ class Toolbar extends React.Component { ...@@ -51,50 +60,78 @@ class Toolbar extends React.Component {
render() { render() {
const { viewType, onViewTypeChange, classes, showInfo, onShowInfoChange } = const { viewType, onViewTypeChange, classes, showInfo, onShowInfoChange } =
this.props this.props
const size = 'small'
return ( return (
<div className={classes.buttons}> <div className={classes.buttons}>
<Button
classes={{ root: classes.button }}
color={color}
size={size}
variant='outlined'
startIcon={<CreateNewFolderIcon />}
>
{messages.get(messages.NEW_FOLDER)}
</Button>
<ToggleButton <ToggleButton
styles={{ root: classes.button }} classes={{ root: classes.toggleButton }}
color={color}
size={size}
selected={showInfo} selected={showInfo}
onChange={onShowInfoChange} onChange={onShowInfoChange}
value={messages.get(messages.INFO)} value={messages.get(messages.INFO)}
aria-label={messages.get(messages.INFO)} aria-label={messages.get(messages.INFO)}
size='small'
> >
<InfoIcon /> <InfoIcon />
</ToggleButton> </ToggleButton>
<Button <Button
styles={{ root: classes.button }} classes={{ root: classes.button }}
label={messages.get(messages.NEW_FOLDER)} color={color}
startIcon={<CreateNewFolderIcon />} size={size}
/> variant='outlined'
<Button >
styles={{ root: classes.button }} <SearchIcon />
label={messages.get(messages.SEARCH)} </Button>
startIcon={<SearchIcon />}
/>
{viewType === 'list' && ( {viewType === 'list' && (
<Button <Button
styles={{ root: classes.button }} classes={{ root: classes.button }}
label={<ViewComfyIcon />} color={color}
onClick={() => onViewTypeChange('grid')} size={size}
/> variant='outlined'
onClick={() => onViewTypeChange('grid')}
>
<ViewComfyIcon />
</Button>
)} )}
{viewType === 'grid' && ( {viewType === 'grid' && (
<Button <Button
styles={{ root: classes.button }} classes={{ root: classes.button }}
label={<ViewListIcon />} color={color}
size={size}
variant='outlined'
onClick={() => onViewTypeChange('list')} onClick={() => onViewTypeChange('list')}
/> >
<ViewListIcon />
</Button>
)} )}
<Button <Button
styles={{ root: classes.button }} classes={{ root: classes.button }}
label={<SettingsIcon />} /> color={color}
size={size}
variant='outlined'
onClick={() => onViewTypeChange('list')}
>
<SettingsIcon />
</Button>
<Button <Button
styles={{ root: classes.button }} classes={{ root: classes.button }}
label={messages.get(messages.UPLOAD)} color={color}
size={size}
variant='contained'
startIcon={<PublishIcon />} startIcon={<PublishIcon />}
/> onClick={() => onViewTypeChange('list')}
>
{messages.get(messages.UPLOAD)}
</Button>
</div> </div>
) )
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment