@@ -20,7 +20,7 @@ frontend-plugin-notifications
2020Purpose
2121=======
2222
23- This is the repository for storing Notification frontend plugin. Intended to be used with
23+ This is the repository for storing Notification Tray frontend plugin. Intended to be used with
2424the `frontend-plugin-framework `_.
2525
2626.. _frontend-plugin-framework : https://github.com/openedx/frontend-plugin-framework
@@ -31,53 +31,46 @@ Getting Started
3131Devstack Installation
3232---------------------
3333
34- These plugins are intended to be used with Header component. Make sure to follow the instructions on the MFE's
34+ This plugin is intended to be used with Header component. Make sure to follow the instructions on the MFE's
3535repository README for getting set up in a devstack.
3636
37+ Header in MFE should contain a plugin slot component to render the notifications tray.
38+
3739Local Development
3840-----------------
3941
4042Clone this repository into your main workspace folder.
4143
42- Insert the following into the ``env.config.js `` file of MFE. If you haven't created one, create one
43- in the root that includes the following::
44-
44+ Insert the following into the ``env.config.js `` file of MFE. If it doesn't exist, create one
45+ in the root and add the following configuration::
4546
47+ ```
4648// Imports from frontend-plugin-framework
4749import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-framework';
4850
4951// Import plugin components from the npm package
50- import { Notifications, useAppNotifications } from '@edx/frontend-plugin-notifications';
51-
52- // Component to render notifications
53- const NotificationsComponent = () => {
54- const { notificationAppData } = useAppNotifications();
55- return notificationAppData?.showNotificationsTray
56- ? <Notifications notificationAppData={notificationAppData} />
57- : '';
58- };
52+ import NotificationsTray from '@edx/frontend-plugin-notifications';
5953
6054const config = {
6155 pluginSlots: {
62-
63- // Add configuration for each `notifications_slot `. This is the ID for the <PluginSlot> component
64- notifications_slot: {
56+ // Add configuration for each notifications_slot. This is the ID for the <PluginSlot> component
57+ notifications_tray: {
6558 plugins: [
6659 {
6760 op: PLUGIN_OPERATIONS.Insert,
6861 widget: {
6962 id: 'notifications_tray',
7063 type: DIRECT_PLUGIN,
71- RenderWidget: NotificationsComponent ,
64+ RenderWidget: NotificationsTray ,
7265 },
7366 },
7467 ],
7568 },
7669 },
7770};
78-
7971export default config;
8072
73+ ```
8174
8275To develop while using this plugin library, modify the ``module.config.js `` file in the root of the MFE you are
8376developing in to reference the local version of the plugin.::
0 commit comments