From 2fef91968d25172bcace100a34d3faff1a1eb927 Mon Sep 17 00:00:00 2001 From: Apple Date: Mon, 7 Oct 2024 13:26:01 -0230 Subject: [PATCH 1/3] Update NotificationPopup.tsx --- lib/components/Notifications/NotificationPopup.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/components/Notifications/NotificationPopup.tsx b/lib/components/Notifications/NotificationPopup.tsx index e0c91c3..44f43ee 100644 --- a/lib/components/Notifications/NotificationPopup.tsx +++ b/lib/components/Notifications/NotificationPopup.tsx @@ -30,6 +30,7 @@ export type NotificationPopupProps = { notification?: NotificationProps['renderer']; }; header?: InboxHeaderProps; + style?: React.CSSProperties; }; export const NotificationPopup: React.FC = (props) => { @@ -75,7 +76,8 @@ export const NotificationPopup: React.FC = (props) => { }, renderers: { notification: props.renderers?.notification - } + }, + style: props.style || {} }; return ( From 5449b40c07d5e6a80c00fd42e4aa87db119f267a Mon Sep 17 00:00:00 2001 From: Apple Date: Mon, 7 Oct 2024 13:53:36 -0230 Subject: [PATCH 2/3] Update NotificationPopup.tsx --- lib/components/Notifications/NotificationPopup.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/components/Notifications/NotificationPopup.tsx b/lib/components/Notifications/NotificationPopup.tsx index 44f43ee..379588b 100644 --- a/lib/components/Notifications/NotificationPopup.tsx +++ b/lib/components/Notifications/NotificationPopup.tsx @@ -105,7 +105,8 @@ export const NotificationPopup: React.FC = (props) => { arrow={false} overlayStyle={{ padding: '0 16px', - width: config.popupWidth + width: config.popupWidth, + ...config.style }} zIndex={props.popupZIndex} > From 3faa6d649a5ca11c7acd7d560207c124d1039e7e Mon Sep 17 00:00:00 2001 From: Apple Date: Mon, 7 Oct 2024 15:30:36 -0230 Subject: [PATCH 3/3] updated props --- lib/components/Notifications/NotificationLauncher.tsx | 10 ++++++---- lib/components/Notifications/NotificationPopup.tsx | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/components/Notifications/NotificationLauncher.tsx b/lib/components/Notifications/NotificationLauncher.tsx index 1aa3683..60c1c76 100644 --- a/lib/components/Notifications/NotificationLauncher.tsx +++ b/lib/components/Notifications/NotificationLauncher.tsx @@ -8,13 +8,14 @@ import { NotificationAPIContext } from '../Provider'; import { NotificationPreferencesPopup } from '../Preferences'; import { Position } from './interface'; -type NotificationLaucherProps = NotificationPopupProps & { +type NotificationLauncherProps = NotificationPopupProps & { position?: keyof typeof Position; offsetX?: number | string; offsetY?: number | string; + customStyle?: React.CSSProperties; }; -export const NotificationLauncher: React.FC = ( +export const NotificationLauncher: React.FC = ( props ) => { const [openPreferences, setOpenPreferences] = useState(false); @@ -24,7 +25,7 @@ export const NotificationLauncher: React.FC = ( return null; } - const config: Required = { + const config: Required = { buttonIcon: props.buttonIcon || ( = ( }, renderers: { notification: props.renderers?.notification - } + }, + customStyle: props.customStyle || {} }; return ( diff --git a/lib/components/Notifications/NotificationPopup.tsx b/lib/components/Notifications/NotificationPopup.tsx index 379588b..1a6b384 100644 --- a/lib/components/Notifications/NotificationPopup.tsx +++ b/lib/components/Notifications/NotificationPopup.tsx @@ -30,7 +30,7 @@ export type NotificationPopupProps = { notification?: NotificationProps['renderer']; }; header?: InboxHeaderProps; - style?: React.CSSProperties; + customStyle?: React.CSSProperties; }; export const NotificationPopup: React.FC = (props) => { @@ -77,7 +77,7 @@ export const NotificationPopup: React.FC = (props) => { renderers: { notification: props.renderers?.notification }, - style: props.style || {} + customStyle: props.customStyle || {} }; return ( @@ -106,7 +106,7 @@ export const NotificationPopup: React.FC = (props) => { overlayStyle={{ padding: '0 16px', width: config.popupWidth, - ...config.style + ...config.customStyle }} zIndex={props.popupZIndex} >