Skip to content

Commit

Permalink
Update dialogs to instead use maxWidth lg, rather than setting it to …
Browse files Browse the repository at this point in the history
…none (#1014)

- There were some changes in mui v6 that are hard to pin down, but amongst them is dialog classes / styles changed a bit.  Previously it seemed like setting no max width would be a good solution, but it messes with too many dialogs.  A better middle ground appears to be setting the maxWidth for the dialog to lg for now.
  • Loading branch information
andrewkfiedler authored Feb 25, 2025
1 parent 45a7262 commit ec831d5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const useDialog = useDialogContext

export const DialogProvider = (props: DialogProviderProps) => {
const [dialogProps, setDialogProps] = React.useState({
maxWidth: 'lg',
children: <></>,
open: false,
onClose: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,6 @@ const ItemRow = ({
}}
onClick={() => {
dialogContext.setProps({
PaperProps: {
style: {
minWidth: 'none',
},
},
open: true,
children: CustomAttributeEditor ? (
<CustomAttributeEditor
Expand Down Expand Up @@ -805,14 +800,8 @@ const TransferList = ({
</div>
<DarkDivider className="w-full h-min" />
<DialogContent>
<Grid
container
spacing={2}
justifyContent="center"
alignItems="center"
className="m-auto"
>
<Grid item>
<div className="flex flex-row justify-center items-center space-x-2 flex-nowrap w-full">
<div>
<CustomList
title="Active"
items={left}
Expand All @@ -829,9 +818,9 @@ const TransferList = ({
totalPossible={totalPossible}
mode={mode}
/>
</Grid>
<Grid item>
<Grid container direction="column" alignItems="center">
</div>
<div>
<div className="flex flex-col items-center">
<Button
data-id="move-right-button"
variant="outlined"
Expand All @@ -852,9 +841,9 @@ const TransferList = ({
>
<LeftArrowIcon />
</Button>
</Grid>
</Grid>
<Grid item>
</div>
</div>
<div>
<CustomList
title="Hidden"
items={right}
Expand All @@ -869,8 +858,8 @@ const TransferList = ({
mode={mode}
totalPossible={totalPossible}
/>
</Grid>
</Grid>
</div>
</div>
</DialogContent>
<DarkDivider className="w-full h-min" />
<DialogActions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,13 +647,6 @@ export const Provider = ({ children }: { children: any }) => {
},
},
},
MuiDialog: {
styleOverrides: {
paper: {
maxWidth: 'none',
},
},
},
MuiPaper: {
styleOverrides: {
root: { backgroundImage: 'unset' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ export const ResultsCommonControls = ({
data-id="manage-attributes-button"
onClick={() => {
dialogContext.setProps({
PaperProps: {
style: {
minWidth: 'none',
},
elevation: Elevations.panels,
},
open: true,
disableEnforceFocus: true,
children: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import Button from '@mui/material/Button'
import user from '../../component/singletons/user-instance'
import TransferList from '../../component/tabs/metacard/transfer-list'
import { Elevations } from '../../component/theme/theme'
import { useDialog } from '../../component/dialog'
import { TypedUserInstance } from '../../component/singletons/TypedUser'
import { StartupDataStore } from '../../js/model/Startup/startup'
Expand All @@ -30,12 +29,6 @@ export default ({ isExport = false }: { isExport?: boolean }) => {
data-id="manage-attributes-button"
onClick={() => {
dialogContext.setProps({
PaperProps: {
style: {
minWidth: 'none',
},
elevation: Elevations.panels,
},
open: true,
disableEnforceFocus: true,
children: (
Expand Down

0 comments on commit ec831d5

Please sign in to comment.