From 6633b0b3676234fdd95c1615b7be8ff1a3eca25c Mon Sep 17 00:00:00 2001 From: hornta <4553604+hornta@users.noreply.github.com> Date: Sun, 11 Sep 2022 01:21:48 +0200 Subject: [PATCH] refactor: remove unused parameter --- .../NotificationsProvider/NotificationsProvider.tsx | 2 +- .../get-position-styles/get-position-styles.test.ts | 12 ++++++------ .../get-position-styles/get-position-styles.ts | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) 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 = {};