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

Create a MenuItem variant instead of using inline sx styles #3823

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/components/CanvasAnnotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export class CanvasAnnotations extends Component {
{annotations.map((annotation) => (
<MenuItem
component={listContainerComponent}
variant="multiline"
sx={{
'&:hover,&:focus': {
backgroundColor: 'action.hover',
Expand All @@ -80,7 +81,6 @@ export class CanvasAnnotations extends Component {
borderBottom: '0.5px solid',
borderBottomColor: 'divider',
cursor: 'pointer',
whiteSpace: 'normal',
}}
key={annotation.id}
annotationid={annotation.id}
Expand Down
4 changes: 2 additions & 2 deletions src/components/CollectionDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class CollectionDialog extends Component {
<MenuItem
key={c.id}
onClick={() => { this.selectCollection(c); }}
sx={{ whiteSpace: 'normal' }}
variant="multiline"
>
{CollectionDialog.getUseableLabel(c)}
</MenuItem>
Expand All @@ -271,7 +271,7 @@ export class CollectionDialog extends Component {
<MenuItem
key={m.id}
onClick={() => { this.selectManifest(m); }}
sx={{ whiteSpace: 'normal' }}
variant="multiline"
>
{CollectionDialog.getUseableLabel(m)}
</MenuItem>
Expand Down
2 changes: 1 addition & 1 deletion src/components/WindowSideBarCollectionPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ function Item({
alignItems="flex-start"
button
component="li"
variant="multiline"
sx={{
borderBottom: '0.5px solid',
borderBottomColor: 'divider',
paddingRight: 1,
whiteSpace: 'normal',
}}
{...otherProps}
>
Expand Down
8 changes: 8 additions & 0 deletions src/config/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ export default {
useNextVariants: true // set so that console deprecation warning is removed
},
components: {
MuiMenuItem: {
variants: [
{
props: { variant: 'multiline' },
style: { whiteSpace: 'normal' }
},
]
},
CompanionWindowSection: {
styleOverrides: {
root: {
Expand Down