Skip to content

Commit 6e0c99f

Browse files
committed
Merge branch 'master' of github.com:mantinedev/mantine
2 parents bedc4f8 + 272d697 commit 6e0c99f

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

packages/@mantine/core/src/components/AppShell/AppShell.module.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
}
6262

6363
:where([data-mode='static'][data-layout='alt']) & {
64-
grid-row: var(--app-shell-navbar-grid-row-alt, var(--app-shell-navbar-grid-row, auto));
64+
grid-row: 1 / -1;
65+
height: 100%;
6566
}
6667
}
6768

@@ -107,6 +108,10 @@
107108
border-inline-start: 1px solid var(--app-shell-border-color);
108109
}
109110

111+
:where([data-mode='static'][data-layout='alt']) & {
112+
grid-row: 1 / -1;
113+
}
114+
110115
:where([data-scroll-locked]) & {
111116
visibility: var(--app-shell-aside-scroll-locked-visibility);
112117
}
@@ -149,6 +154,7 @@
149154
}
150155

151156
:where([data-mode='static'][data-layout='alt']) & {
157+
grid-column: var(--app-shell-main-column-start, 1) / var(--app-shell-main-column-end, -1);
152158
margin-inline-start: 0rem;
153159
margin-inline-end: 0rem;
154160
}
@@ -183,6 +189,10 @@
183189
grid-row: var(--app-shell-footer-grid-row, auto);
184190
}
185191

192+
:where([data-mode='static'][data-layout='alt']) & {
193+
grid-column: var(--app-shell-main-column-start, 1) / var(--app-shell-main-column-end, -1);
194+
}
195+
186196
&:where([data-with-border]) {
187197
border-top: 1px solid var(--app-shell-border-color);
188198
}

packages/@mantine/modals/src/ModalsProvider.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
OpenContextModal,
1313
} from './context';
1414
import { useModalsEvents } from './events';
15-
import { modalsReducer } from './reducer';
15+
import { handleCloseModal, modalsReducer } from './reducer';
1616

1717
export interface ModalsProviderProps {
1818
/** Your app */
@@ -74,6 +74,12 @@ export function ModalsProvider({ children, modalProps, labels, modals }: ModalsP
7474

7575
const closeAll = useCallback(
7676
(canceled?: boolean) => {
77+
stateRef.current.modals
78+
.concat()
79+
.reverse()
80+
.forEach((modal) => {
81+
handleCloseModal(modal, canceled);
82+
});
7783
dispatch({ type: 'CLOSE_ALL', canceled });
7884
},
7985
[stateRef, dispatch]
@@ -131,6 +137,10 @@ export function ModalsProvider({ children, modalProps, labels, modals }: ModalsP
131137

132138
const closeModal = useCallback(
133139
(id: string, canceled?: boolean) => {
140+
const modal = stateRef.current.modals.find((m) => m.id === id);
141+
if (modal) {
142+
handleCloseModal(modal, canceled);
143+
}
134144
dispatch({ type: 'CLOSE', modalId: id, canceled });
135145
},
136146
[stateRef, dispatch]

packages/@mantine/modals/src/reducer.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface UpdateAction {
3232
newProps: Partial<ModalSettings>;
3333
}
3434

35-
function handleCloseModal(modal: ModalState, canceled?: boolean) {
35+
export function handleCloseModal(modal: ModalState, canceled?: boolean) {
3636
if (canceled && modal.type === 'confirm') {
3737
modal.props.onCancel?.();
3838
}
@@ -57,8 +57,6 @@ export function modalsReducer(
5757
return state;
5858
}
5959

60-
handleCloseModal(modal, action.canceled);
61-
6260
const remainingModals = state.modals.filter((m) => m.id !== action.modalId);
6361

6462
return {
@@ -71,14 +69,6 @@ export function modalsReducer(
7169
return state;
7270
}
7371

74-
// Resolve modal stack from top to bottom
75-
state.modals
76-
.concat()
77-
.reverse()
78-
.forEach((modal) => {
79-
handleCloseModal(modal, action.canceled);
80-
});
81-
8272
return {
8373
current: state.current,
8474
modals: [],

0 commit comments

Comments
 (0)