Skip to content

Commit

Permalink
Merge pull request #3852 from ProjectMirador/mui5-flex
Browse files Browse the repository at this point in the history
Style the workspace sidebar with flexbox
  • Loading branch information
jcoyne authored Dec 12, 2023
2 parents 10ac7d3 + 3afd10b commit c03eb24
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 7 additions & 5 deletions src/components/WorkspaceAddButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import Fab from '@mui/material/Fab';
import Tooltip from '@mui/material/Tooltip';
import AddIcon from '@mui/icons-material/AddSharp';
import CloseIcon from '@mui/icons-material/CloseSharp';
import { styled } from '@mui/material/styles';

const Root = styled(Fab, { name: 'WorkspaceAddButton', slot: 'root' })(({ theme }) => ({
marginBottom: theme.spacing(1),
}));

/**
*/
Expand All @@ -18,7 +23,7 @@ export class WorkspaceAddButton extends Component {
} = this.props;
return (
<Tooltip title={isWorkspaceAddVisible ? t('closeAddResourceMenu') : t('addResource')}>
<Fab
<Root
size="medium"
color="primary"
id="addBtn"
Expand All @@ -27,9 +32,6 @@ export class WorkspaceAddButton extends Component {
? t('closeAddResourceMenu')
: ((useExtendedFab && t('startHere')) || t('addResource'))
}
sx={{
margin: 1,
}}
variant={useExtendedFab ? 'extended' : 'circular'}
onClick={() => { setWorkspaceAddVisibility(!isWorkspaceAddVisible); }}
>
Expand All @@ -39,7 +41,7 @@ export class WorkspaceAddButton extends Component {
: <AddIcon />
}
{ useExtendedFab && t('startHere') }
</Fab>
</Root>
</Tooltip>
);
}
Expand Down
13 changes: 6 additions & 7 deletions src/components/WorkspaceControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import Branding from '../containers/Branding';
import ns from '../config/css-ns';

const Root = styled(AppBar, { name: 'WorkspaceControlPanel', slot: 'root' })(({ ownerState, theme }) => ({
display: 'flex',
height: 64,
padding: theme.spacing(1),
paddingBottom: 0,
[theme.breakpoints.up('sm')]: {
height: '100%',
left: 0,
Expand All @@ -24,6 +27,7 @@ const Root = styled(AppBar, { name: 'WorkspaceControlPanel', slot: 'root' })(({

const StyledToolbar = styled(Toolbar, { name: 'WorkspaceControlPanel', slot: 'toolbar' })(({ theme }) => ({
display: 'flex',
flexGrow: 1,
justifyContent: 'space-between',
[theme.breakpoints.up('sm')]: {
flexDirection: 'column',
Expand All @@ -44,18 +48,13 @@ const StyledWorkspaceButtons = styled('div', { name: 'WorkspaceControlPanel', sl

const StyledBranding = styled(Branding, { name: 'WorkspaceControlPanel', slot: 'branding' })(({ theme }) => ({
display: 'flex',
position: 'absolute',
justifyContent: 'center',
[theme.breakpoints.up('xs')]: {
display: 'none',
},
[theme.breakpoints.up('sm')]: {
bottom: 0,
display: 'block',
float: 'none',
right: 'auto',
width: '100%',
display: 'flex',
},
right: 0,
}));

/**
Expand Down

0 comments on commit c03eb24

Please sign in to comment.