diff --git a/src/mantine-notifications/src/NotificationsProvider/NotificationsProvider.tsx b/src/mantine-notifications/src/NotificationsProvider/NotificationsProvider.tsx index c7d73afcf07..6bd8f86942d 100644 --- a/src/mantine-notifications/src/NotificationsProvider/NotificationsProvider.tsx +++ b/src/mantine-notifications/src/NotificationsProvider/NotificationsProvider.tsx @@ -154,7 +154,7 @@ export function NotificationsProvider({ style={style} sx={{ maxWidth: containerWidth, - ...getPositionStyles(positioning, containerWidth, theme.spacing.md), + ...getPositionStyles(positioning, theme.spacing.md), }} {...others} > diff --git a/src/mantine-notifications/src/NotificationsProvider/get-position-styles/get-position-styles.test.ts b/src/mantine-notifications/src/NotificationsProvider/get-position-styles/get-position-styles.test.ts index 8048f214f3c..77fddebe252 100644 --- a/src/mantine-notifications/src/NotificationsProvider/get-position-styles/get-position-styles.test.ts +++ b/src/mantine-notifications/src/NotificationsProvider/get-position-styles/get-position-styles.test.ts @@ -2,20 +2,20 @@ import getPositionStyles from './get-position-styles'; describe('@mantine/notifications/get-position-styles', () => { it('returns correct values for all positions', () => { - expect(getPositionStyles(['top', 'left'], 400, 20)).toStrictEqual({ top: 20, left: 20 }); - expect(getPositionStyles(['top', 'right'], 400, 20)).toStrictEqual({ top: 20, right: 20 }); - expect(getPositionStyles(['top', 'center'], 400, 20)).toStrictEqual({ + expect(getPositionStyles(['top', 'left'], 20)).toStrictEqual({ top: 20, left: 20 }); + expect(getPositionStyles(['top', 'right'], 20)).toStrictEqual({ top: 20, right: 20 }); + expect(getPositionStyles(['top', 'center'], 20)).toStrictEqual({ top: 20, left: '50%', transform: 'translateX(-50%)', }); - expect(getPositionStyles(['bottom', 'left'], 400, 20)).toStrictEqual({ bottom: 20, left: 20 }); - expect(getPositionStyles(['bottom', 'right'], 400, 20)).toStrictEqual({ + expect(getPositionStyles(['bottom', 'left'], 20)).toStrictEqual({ bottom: 20, left: 20 }); + expect(getPositionStyles(['bottom', 'right'], 20)).toStrictEqual({ bottom: 20, right: 20, }); - expect(getPositionStyles(['bottom', 'center'], 400, 20)).toStrictEqual({ + expect(getPositionStyles(['bottom', 'center'], 20)).toStrictEqual({ bottom: 20, left: '50%', transform: 'translateX(-50%)', diff --git a/src/mantine-notifications/src/NotificationsProvider/get-position-styles/get-position-styles.ts b/src/mantine-notifications/src/NotificationsProvider/get-position-styles/get-position-styles.ts index 79ad15045fc..131ecc6b244 100644 --- a/src/mantine-notifications/src/NotificationsProvider/get-position-styles/get-position-styles.ts +++ b/src/mantine-notifications/src/NotificationsProvider/get-position-styles/get-position-styles.ts @@ -3,7 +3,6 @@ import { NotificationsProviderPositioning } from '../../types'; export default function getPositionStyles( [vertical, horizontal]: NotificationsProviderPositioning, - containerWidth: number, spacing: number ) { const styles: CSSObject = {};