Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/package-cooldown-allowlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"allowlist": [
{
"name": "@notificationapi/core",
"version": "1.2.9",
"version": "2.0.0",
"reason": "Required for NotificationAPI React Client SDK, internal dependency",
"approvedBy": "millerm30",
"approvedAt": "2026-09-08"
"approvedAt": "2026-09-24"
}
]
}
26 changes: 0 additions & 26 deletions lib/components/Notifications/NotificationFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import { InboxHeaderProps } from './InboxHeader';
import { NotificationPreferencesPopup } from '../Preferences';
import { InAppNotification } from '@notificationapi/core/dist/interfaces';
import { Filter, Pagination } from './interface';
import Divider from '@mui/material/Divider';
import { useTheme } from '@mui/material/styles';
import WebPushOptInMessage from '../WebPush/WebPushOptInMessage';
import Language from '@mui/icons-material/Language';
import { getThemeColors } from '../../utils/theme';

export type NotificationFeedProps = {
Expand Down Expand Up @@ -95,29 +92,6 @@ export const NotificationFeed: React.FC<NotificationFeedProps> = (props) => {
imageShape={config.imageShape}
newTab={config.newTab}
/>
{context.webPushOptInMessage &&
localStorage.getItem('hideWebPushOptInMessage') !== 'true' && (
<div>
<Divider
style={{ margin: '10px 0', borderColor: themeColors.divider }}
/>
<WebPushOptInMessage
hideAfterInteraction={true}
icon={<Language type="text" style={{ marginLeft: '9px' }} />}
descriptionStyle={{
flexDirection: 'column', // Stack the elements vertically
justifyContent: 'flex-start', // Align items to the left
fontSize: '14px',
alignItems: 'flex-start' // Align items to the left
}}
buttonContainerStyle={{
justifyContent: 'flex-start', // Align buttons to the left
alignItems: 'flex-start', // Align buttons to the left
marginTop: '10px' // Add some space between message and buttons
}}
/>
</div>
)}
<NotificationPreferencesPopup
open={openPreferences}
onClose={() => setOpenPreferences(false)}
Expand Down
23 changes: 2 additions & 21 deletions lib/components/Notifications/NotificationLauncher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { NotificationPopupProps } from './NotificationPopup';
import { NotificationAPIContext } from '../Provider/context';
import { NotificationPreferencesPopup } from '../Preferences';
import { Position } from './interface';
import { LanguageOutlined, NotificationsOutlined } from '@mui/icons-material';
import { Divider, IconButton, Popover, useTheme } from '@mui/material';
import WebPushOptInMessage from '../WebPush/WebPushOptInMessage';
import { NotificationsOutlined } from '@mui/icons-material';
import { IconButton, Popover, useTheme } from '@mui/material';
import { getThemeColors } from '../../utils/theme';

type NotificationLaucherProps = NotificationPopupProps & {
Expand Down Expand Up @@ -149,24 +148,6 @@ export const NotificationLauncher: React.FC<NotificationLaucherProps> = (
header={config.header}
newTab={config.newTab}
/>
{context.webPushOptInMessage &&
localStorage.getItem('hideWebPushOptInMessage') !== 'true' && (
<div>
<Divider
style={{ margin: '10px 0', borderColor: themeColors.divider }}
/>
<WebPushOptInMessage
hideAfterInteraction={true}
icon={
<LanguageOutlined
type="text"
style={{ marginLeft: '9px' }}
/>
}
alertContainerStyle={{ maxWidth: '345px' }}
/>
</div>
)}
</div>
</Popover>
<NotificationPreferencesPopup
Expand Down
12 changes: 1 addition & 11 deletions lib/components/Notifications/NotificationPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import { InAppNotification } from '@notificationapi/core/dist/interfaces';
import { NotificationPreferencesPopup } from '../Preferences';
import { InboxHeaderProps } from './InboxHeader';
import { Filter, Pagination } from './interface';
import { Divider, IconButton, Popover, useTheme } from '@mui/material';
import { IconButton, Popover, useTheme } from '@mui/material';
import NotificationsOutlined from '@mui/icons-material/NotificationsOutlined';
import WebPushOptInMessage from '../WebPush/WebPushOptInMessage';
import { getThemeColors } from '../../utils/theme';

export type NotificationPopupProps = {
Expand Down Expand Up @@ -152,15 +151,6 @@ export const NotificationPopup: React.FC<NotificationPopupProps> = (props) => {
header={config.header}
newTab={config.newTab}
/>
{context.webPushOptInMessage &&
localStorage.getItem('hideWebPushOptInMessage') !== 'true' && (
<div>
<Divider
style={{ margin: '10px 0', borderColor: themeColors.divider }}
/>
<WebPushOptInMessage hideAfterInteraction={true} />
</div>
)}
</div>
</Popover>
<NotificationPreferencesPopup
Expand Down
26 changes: 2 additions & 24 deletions lib/components/Preferences/NotificationPreferencesInline.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { useContext } from 'react';
import { Preferences } from './Preferences';
import { NotificationAPIContext } from '../Provider/context';
import { Divider, useTheme } from '@mui/material';
import WebPushOptInMessage from '../WebPush/WebPushOptInMessage';
import { useTheme } from '@mui/material';
import { getThemeColors } from '../../utils/theme';

type NotificationPreferencesInlineProps = object;
Expand All @@ -26,28 +25,7 @@ export function NotificationPreferencesInline(
color: themeColors.text
}}
>
<Preferences />{' '}
{context.webPushOptInMessage && (
<div>
<Divider
style={{ margin: '10px 0', borderColor: themeColors.divider }}
/>
<WebPushOptInMessage
hideAfterInteraction={false}
descriptionStyle={{
flexDirection: 'column', // Stack the elements vertically
justifyContent: 'flex-start', // Align items to the left
fontSize: '14px',
alignItems: 'flex-start' // Align items to the left
}}
buttonContainerStyle={{
justifyContent: 'flex-start', // Align buttons to the left
alignItems: 'flex-start', // Align buttons to the left
marginTop: '10px' // Add some space between message and buttons
}}
/>
</div>
)}
<Preferences />
</div>
);
}
9 changes: 0 additions & 9 deletions lib/components/Preferences/NotificationPreferencesPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useContext } from 'react';
import { Preferences } from './Preferences';
import { NotificationAPIContext } from '../Provider/context';
import { Dialog, DialogTitle, DialogContent, useTheme } from '@mui/material';
import WebPushOptInMessage from '../WebPush/WebPushOptInMessage';
import { getThemeColors } from '../../utils/theme';

type NotificationPreferencesPopupProps = {
Expand Down Expand Up @@ -50,14 +49,6 @@ export function NotificationPreferencesPopup(
sx={{ backgroundColor: themeColors.paper, color: themeColors.text }}
>
<Preferences />
{context.webPushOptInMessage && (
<div>
<WebPushOptInMessage
hideAfterInteraction={false}
descriptionStyle={{ fontSize: 12 }}
/>
</div>
)}
</DialogContent>
</Dialog>
);
Expand Down
4 changes: 4 additions & 0 deletions lib/components/Preferences/PreferenceInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export const PreferenceInput = ({
return (
<>
{(notification.channels as Channels[])
.filter(
(channel) =>
channel !== Channels.WEB_PUSH && channel !== Channels.SLACK
)
.sort(sortChannels)
.map((channel: Channels, i) => {
const preference = preferences.find(
Expand Down
5 changes: 0 additions & 5 deletions lib/components/Provider/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export type Context = {
notifications?: InAppNotification[];
preferences?: GetPreferencesResponse;
userAccountMetaData?: { userAccountMetadata: UserAccountMetadata };
webPushOptInMessage?: 'AUTOMATIC' | boolean;
loadNotifications: (initial?: boolean) => void;
markAsOpened: () => void;
markAsArchived: (ids: string[] | 'ALL') => void;
Expand All @@ -41,10 +40,6 @@ export type Context = {
}[]
) => void;
getClient: () => typeof NotificationAPIClientSDK;
setWebPushOptInMessage: React.Dispatch<
React.SetStateAction<'AUTOMATIC' | boolean>
>;
setWebPushOptIn: React.Dispatch<React.SetStateAction<boolean>>;
};

export const NotificationAPIContext = createContext<Context | undefined>(
Expand Down
Loading
Loading