File tree Expand file tree Collapse file tree 4 files changed +13
-18
lines changed
Expand file tree Collapse file tree 4 files changed +13
-18
lines changed Original file line number Diff line number Diff line change 11import { useIntl } from '@openedx/frontend-base' ;
22import messages from './messages' ;
3- import InstructorTabsSlot from '../slots/instructorTabsSlot/instructorTabsSlot ' ;
3+ import InstructorTabsSlot from '../slots/instructorTabsSlot/InstructorTabsSlot ' ;
44
55const PageWrapper = ( { children } : { children : React . ReactNode } ) => {
66 const { formatMessage } = useIntl ( ) ;
Original file line number Diff line number Diff line change @@ -16,11 +16,9 @@ Slots in `frontend-app-instruct` use the slot system from `@openedx/frontend-bas
1616
1717### 1. Slot Operations Definition
1818
19- The ` src/instructorTabs/app.tsx ` file shows how to define slot operations:
20-
2119``` tsx
2220import { SlotOperation , WidgetOperationTypes } from ' @openedx/frontend-base' ;
23- import TabSlot from ' .. /slots/instructorTabsSlot/TabSlot ' ;
21+ import { InstructorTab } from ' src /slots/instructorTabsSlot/InstructorTabsSlot ' ;
2422
2523// Tab configuration data
2624const tabData = { tab_id: ' course_info' , url: ' course_info' , title: ' Course Info' };
@@ -30,7 +28,7 @@ export const tabSlots: SlotOperation[] = [{
3028 slotId: ` org.openedx.frontend.slot.instructor.tabs.v1 ` ,
3129 id: ` org.openedx.frontend.widget.instructor.tab.${tab_id } ` ,
3230 op: WidgetOperationTypes .APPEND ,
33- element: <TabSlot tab_id = { tabData .tab_id } title = { tabData .title } url = { tabData .url } />,
31+ element: <InstructorTab tab_id = { tabData .tab_id } title = { tabData .title } url = { tabData .url } />,
3432}];
3533```
3634
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import { Slot } from '@openedx/frontend-base' ;
2- import InstructorTabs from '../../instructorTabs/InstructorTabs' ;
2+ import InstructorTabs , { TabProps } from '../../instructorTabs/InstructorTabs' ;
3+
4+ // This component will be a placeholder/dummy component just to retrieve Tab props
5+ // Since we are using a slot-based architecture and Paragon is passing Tabs/Tab through
6+ // We can't have context provider between Tabs and Tab when rendering it should be direct parent/children relation
7+
8+ /* eslint-disable @typescript-eslint/no-unused-vars */
9+ export const InstructorTab = ( _props : TabProps ) => {
10+ return null ;
11+ } ;
312
413export const InstructorTabsSlot = ( ) => (
514 < Slot id = "org.openedx.frontend.slot.instructor.tabs.v1" >
You can’t perform that action at this time.
0 commit comments