Skip to content

Commit 0f7d18e

Browse files
fix: update read me and rename instructor tab
1 parent 4ac0580 commit 0f7d18e

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

src/pageWrapper/PageWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useIntl } from '@openedx/frontend-base';
22
import messages from './messages';
3-
import InstructorTabsSlot from '../slots/instructorTabsSlot/instructorTabsSlot';
3+
import InstructorTabsSlot from '../slots/instructorTabsSlot/InstructorTabsSlot';
44

55
const PageWrapper = ({ children }: { children: React.ReactNode }) => {
66
const { formatMessage } = useIntl();

src/slots/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff 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
2220
import { 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
2624
const 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

src/slots/instructorTabsSlot/TabSlot.tsx

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

src/slots/instructorTabsSlot/instructorTabsSlot.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
import { 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

413
export const InstructorTabsSlot = () => (
514
<Slot id="org.openedx.frontend.slot.instructor.tabs.v1">

0 commit comments

Comments
 (0)