Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull workspace styles up #3838

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions src/components/Workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ import WorkspaceElastic from '../containers/WorkspaceElastic';
import ns from '../config/css-ns';
import { IIIFDropTarget } from './IIIFDropTarget';

const StyledWorkspaceViewport = styled('div')(() => ({
const Root = styled('div', { name: 'Workspace', slot: 'root' })(({ ownerState, theme }) => ({
'@media (min-width: 600px)': {
...(ownerState.isWorkspaceControlPanelVisible && {
paddingLeft: theme.spacing(8.5),
paddingTop: 0,
}),
},
...(ownerState.isWorkspaceControlPanelVisible && {
paddingTop: theme.spacing(9.25),
}),
bottom: 0,
left: 0,
margin: 0,
Expand Down Expand Up @@ -123,18 +132,8 @@ export class Workspace extends Component {

return (
<IIIFDropTarget onDrop={this.handleDrop}>
<StyledWorkspaceViewport
sx={{
'@media (min-width: 600px)': {
...(isWorkspaceControlPanelVisible && {
paddingLeft: 8.5,
paddingTop: 0,
}),
},
...(isWorkspaceControlPanelVisible && {
paddingTop: 9.25,
}),
}}
<Root
ownerState={this.props}
className={
classNames(
ns('workspace-viewport'),
Expand All @@ -144,7 +143,7 @@ export class Workspace extends Component {
>
<Typography style={visuallyHidden} component="h1">{t('miradorViewer')}</Typography>
{this.workspaceByType()}
</StyledWorkspaceViewport>
</Root>
</IIIFDropTarget>
);
}
Expand Down