Skip to content

Commit 3dd42d7

Browse files
authored
Clean up NotificationService imports (#22072)
1 parent b71fb05 commit 3dd42d7

File tree

5 files changed

+8
-13
lines changed

5 files changed

+8
-13
lines changed

airbyte-webapp/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { ConfirmationModalService } from "hooks/services/ConfirmationModal";
1414
import { defaultOssFeatures, FeatureService } from "hooks/services/Feature";
1515
import { FormChangeTrackerService } from "hooks/services/FormChangeTracker";
1616
import { ModalServiceProvider } from "hooks/services/Modal";
17-
import NotificationService from "hooks/services/Notification";
17+
import { NotificationService } from "hooks/services/Notification";
1818
import { AnalyticsProvider } from "views/common/AnalyticsProvider";
1919
import { StoreProvider } from "views/common/StoreProvider";
2020

airbyte-webapp/src/hooks/services/Notification/NotificationService.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Notification, NotificationServiceApi, NotificationServiceState } from "
99

1010
const notificationServiceContext = React.createContext<NotificationServiceApi | null>(null);
1111

12-
const NotificationService = ({ children }: { children: React.ReactNode }) => {
12+
export const NotificationService = React.memo(({ children }: { children: React.ReactNode }) => {
1313
const [state, { addNotification, clearAll, deleteNotificationById }] = useTypesafeReducer<
1414
NotificationServiceState,
1515
typeof actions
@@ -47,7 +47,7 @@ const NotificationService = ({ children }: { children: React.ReactNode }) => {
4747
) : null}
4848
</>
4949
);
50-
};
50+
});
5151

5252
interface NotificationServiceHook {
5353
registerNotification: (notification: Notification) => void;
@@ -82,5 +82,3 @@ export const useNotificationService: (notification?: Notification, dependencies?
8282
unregisterAllNotifications: notificationService.clearAll,
8383
};
8484
};
85-
86-
export default React.memo(NotificationService);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { NotificationService, useNotificationService } from "./NotificationService";
2+
export * from "./types";

airbyte-webapp/src/hooks/services/Notification/index.tsx

Lines changed: 0 additions & 5 deletions
This file was deleted.

airbyte-webapp/src/packages/cloud/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { ConfirmationModalService } from "hooks/services/ConfirmationModal";
1313
import { defaultCloudFeatures, FeatureService } from "hooks/services/Feature";
1414
import { FormChangeTrackerService } from "hooks/services/FormChangeTracker";
1515
import { ModalServiceProvider } from "hooks/services/Modal";
16-
import NotificationServiceProvider from "hooks/services/Notification";
16+
import { NotificationService } from "hooks/services/Notification";
1717
import en from "locales/en.json";
1818
import { Routing } from "packages/cloud/cloudRoutes";
1919
import cloudLocales from "packages/cloud/locales/en.json";
@@ -35,7 +35,7 @@ const Services: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => (
3535
<AnalyticsProvider>
3636
<AppMonitoringServiceProvider>
3737
<ApiErrorBoundary>
38-
<NotificationServiceProvider>
38+
<NotificationService>
3939
<ConfirmationModalService>
4040
<ModalServiceProvider>
4141
<FormChangeTrackerService>
@@ -51,7 +51,7 @@ const Services: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => (
5151
</FormChangeTrackerService>
5252
</ModalServiceProvider>
5353
</ConfirmationModalService>
54-
</NotificationServiceProvider>
54+
</NotificationService>
5555
</ApiErrorBoundary>
5656
</AppMonitoringServiceProvider>
5757
</AnalyticsProvider>

0 commit comments

Comments
 (0)