Skip to content

Commit

Permalink
adapt padding of Dialog elements for mobile screens
Browse files Browse the repository at this point in the history
  • Loading branch information
juliawegmayr committed Jan 15, 2025
1 parent 9f69e7b commit 2d90daf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { mergeOverrideStyles } from "../utils/mergeOverrideStyles";
import { GetMuiComponentTheme } from "./getComponentsTheme";

export const getMuiDialogActions: GetMuiComponentTheme<"MuiDialogActions"> = (component, { palette }) => ({
export const getMuiDialogActions: GetMuiComponentTheme<"MuiDialogActions"> = (component, { palette, breakpoints }) => ({
...component,
styleOverrides: mergeOverrideStyles<"MuiDialogActions">(component?.styleOverrides, {
root: {
borderTop: `1px solid ${palette.grey[100]}`,
padding: 20,
padding: 10,
justifyContent: "space-between",

[breakpoints.up("sm")]: {
padding: 20,
},

"&>:first-of-type:last-child": {
marginLeft: "auto",
},
Expand Down
14 changes: 11 additions & 3 deletions packages/admin/admin-theme/src/componentsTheme/MuiDialogContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,23 @@ import { dialogTitleClasses } from "@mui/material";
import { mergeOverrideStyles } from "../utils/mergeOverrideStyles";
import { GetMuiComponentTheme } from "./getComponentsTheme";

export const getMuiDialogContent: GetMuiComponentTheme<"MuiDialogContent"> = (component, { palette }) => ({
export const getMuiDialogContent: GetMuiComponentTheme<"MuiDialogContent"> = (component, { palette, breakpoints }) => ({
...component,
styleOverrides: mergeOverrideStyles<"MuiDialogContent">(component?.styleOverrides, {
root: {
backgroundColor: palette.grey[50],
padding: 40,
padding: 10,

[`.${dialogTitleClasses.root} + &`]: {
paddingTop: 40,
paddingTop: 10,
},

[breakpoints.up("sm")]: {
padding: 40,

[`.${dialogTitleClasses.root} + &`]: {
paddingTop: 40,
},
},
},
}),
Expand Down
11 changes: 9 additions & 2 deletions packages/admin/admin-theme/src/componentsTheme/MuiDialogTitle.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mergeOverrideStyles } from "../utils/mergeOverrideStyles";
import { GetMuiComponentTheme } from "./getComponentsTheme";

export const getMuiDialogTitle: GetMuiComponentTheme<"MuiDialogTitle"> = (component, { palette, typography }) => ({
export const getMuiDialogTitle: GetMuiComponentTheme<"MuiDialogTitle"> = (component, { palette, typography, breakpoints }) => ({
...component,
defaultProps: {
variant: "subtitle1",
Expand All @@ -10,7 +10,14 @@ export const getMuiDialogTitle: GetMuiComponentTheme<"MuiDialogTitle"> = (compon
root: {
backgroundColor: palette.grey["A200"],
color: "#ffffff",
padding: 20,
padding: 10,
fontSize: "14px",

[breakpoints.up("sm")]: {
minWidth: 0,
fontSize: "16px",
padding: 20,
},
},
}),
});

0 comments on commit 2d90daf

Please sign in to comment.