Skip to content
Snippets Groups Projects
Unverified Commit b924302b authored by Justin Coyne's avatar Justin Coyne Committed by GitHub
Browse files

Merge pull request #3837 from ProjectMirador/mui5-window

Pull Window styles up
parents 66bce438 08760874
No related branches found
No related tags found
2 merge requests!19Draft: Merge video support into mui5,!18Only nudge over badge content for the WindowListButton; it needs special...
...@@ -12,6 +12,23 @@ import ErrorContent from '../containers/ErrorContent'; ...@@ -12,6 +12,23 @@ import ErrorContent from '../containers/ErrorContent';
import IIIFAuthentication from '../containers/IIIFAuthentication'; import IIIFAuthentication from '../containers/IIIFAuthentication';
import { PluginHook } from './PluginHook'; import { PluginHook } from './PluginHook';
const Root = styled(Paper)(({ ownerState, theme }) => ({
backgroundColor: theme.palette.shades?.dark,
borderRadius: 0,
display: 'flex',
flexDirection: 'column',
height: '100%',
minHeight: 0,
overflow: 'hidden',
width: '100%',
...(ownerState?.maximized && {
left: 0,
position: 'absolute',
top: 0,
zIndex: theme.zIndex.modal - 1,
}),
}));
const StyledMiddle = styled('div')(() => ({ const StyledMiddle = styled('div')(() => ({
display: 'flex', display: 'flex',
flex: '1', flex: '1',
...@@ -96,7 +113,7 @@ export class Window extends Component { ...@@ -96,7 +113,7 @@ export class Window extends Component {
*/ */
render() { render() {
const { const {
focusWindow, label, isFetching, maximized, sideBarOpen, focusWindow, label, isFetching, sideBarOpen,
view, windowId, t, view, windowId, t,
manifestError, manifestError,
} = this.props; } = this.props;
...@@ -112,27 +129,12 @@ export class Window extends Component { ...@@ -112,27 +129,12 @@ export class Window extends Component {
} }
return ( return (
<Paper <Root
onFocus={focusWindow} onFocus={focusWindow}
ownerState={this.props}
component="section" component="section"
elevation={1} elevation={1}
id={windowId} id={windowId}
sx={theme => ({
bgcolor: 'shades?.dark',
borderRadius: 0,
display: 'flex',
flexDirection: 'column',
height: '100%',
minHeight: 0,
overflow: 'hidden',
width: '100%',
...(maximized && {
left: 0,
position: 'absolute',
top: 0,
zIndex: theme.zIndex.modal - 1,
}),
})}
className={ns('window')} className={ns('window')}
aria-label={t('window', { label })} aria-label={t('window', { label })}
> >
...@@ -159,7 +161,7 @@ export class Window extends Component { ...@@ -159,7 +161,7 @@ export class Window extends Component {
</StyledMiddle> </StyledMiddle>
<CompanionArea windowId={windowId} position="far-bottom" /> <CompanionArea windowId={windowId} position="far-bottom" />
<PluginHook {...this.props} /> <PluginHook {...this.props} />
</Paper> </Root>
); );
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment