Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style prop added in sdk #12

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/components/Notifications/NotificationLauncher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<NotificationLaucherProps> = (
export const NotificationLauncher: React.FC<NotificationLauncherProps> = (
props
) => {
const [openPreferences, setOpenPreferences] = useState(false);
Expand All @@ -24,7 +25,7 @@ export const NotificationLauncher: React.FC<NotificationLaucherProps> = (
return null;
}

const config: Required<NotificationLaucherProps> = {
const config: Required<NotificationLauncherProps> = {
buttonIcon: props.buttonIcon || (
<BellOutlined
style={{
Expand Down Expand Up @@ -62,7 +63,8 @@ export const NotificationLauncher: React.FC<NotificationLaucherProps> = (
},
renderers: {
notification: props.renderers?.notification
}
},
customStyle: props.customStyle || {}
};

return (
Expand Down
7 changes: 5 additions & 2 deletions lib/components/Notifications/NotificationPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type NotificationPopupProps = {
notification?: NotificationProps['renderer'];
};
header?: InboxHeaderProps;
customStyle?: React.CSSProperties;
};

export const NotificationPopup: React.FC<NotificationPopupProps> = (props) => {
Expand Down Expand Up @@ -75,7 +76,8 @@ export const NotificationPopup: React.FC<NotificationPopupProps> = (props) => {
},
renderers: {
notification: props.renderers?.notification
}
},
customStyle: props.customStyle || {}
};

return (
Expand Down Expand Up @@ -103,7 +105,8 @@ export const NotificationPopup: React.FC<NotificationPopupProps> = (props) => {
arrow={false}
overlayStyle={{
padding: '0 16px',
width: config.popupWidth
width: config.popupWidth,
...config.customStyle
}}
zIndex={props.popupZIndex}
>
Expand Down
Loading