11import { useIntl } from '@edx/frontend-platform/i18n' ;
22import {
3- Button , Dropdown , Icon , OverlayTrigger , Stack , Tooltip ,
3+ Button , OverlayTrigger , Stack , Tooltip ,
44} from '@openedx/paragon' ;
55import {
6- Add as IconAdd , FindInPage , ViewSidebar ,
6+ Add as IconAdd , FindInPage , InfoOutline ,
77} from '@openedx/paragon/icons' ;
88
99import { OutlinePageErrors , XBlockActions } from '@src/data/types' ;
10- import type { SidebarPage } from '@src/generic/sidebar' ;
1110
12- import { type OutlineSidebarPageKeys , useOutlineSidebarContext } from '../outline-sidebar/OutlineSidebarContext' ;
11+ import { useOutlineSidebarContext } from '../outline-sidebar/OutlineSidebarContext' ;
1312
1413import messages from './messages' ;
15- import { getOutlineSidebarPages } from '../outline-sidebar/sidebarPages' ;
1614
1715export interface HeaderActionsProps {
1816 actions : {
@@ -29,12 +27,27 @@ const HeaderActions = ({
2927} : HeaderActionsProps ) => {
3028 const intl = useIntl ( ) ;
3129 const { lmsLink } = actions ;
32- const sidebarPages = getOutlineSidebarPages ( ) ;
3330
3431 const { setCurrentPageKey } = useOutlineSidebarContext ( ) ;
3532
3633 return (
3734 < Stack direction = "horizontal" gap = { 3 } >
35+ < OverlayTrigger
36+ placement = "bottom"
37+ overlay = { (
38+ < Tooltip id = { intl . formatMessage ( messages . courseInfoButtonTooltip ) } >
39+ { intl . formatMessage ( messages . courseInfoButtonTooltip ) }
40+ </ Tooltip >
41+ ) }
42+ >
43+ < Button
44+ iconBefore = { InfoOutline }
45+ onClick = { ( ) => setCurrentPageKey ( 'info' ) }
46+ variant = "outline-primary"
47+ >
48+ { intl . formatMessage ( messages . courseInfoButton ) }
49+ </ Button >
50+ </ OverlayTrigger >
3851 { courseActions . childAddable && (
3952 < OverlayTrigger
4053 placement = "bottom"
@@ -71,31 +84,6 @@ const HeaderActions = ({
7184 { intl . formatMessage ( messages . viewLiveButton ) }
7285 </ Button >
7386 </ OverlayTrigger >
74- < Dropdown >
75- < Dropdown . Toggle
76- id = "dropdown-toggle-with-iconbutton"
77- as = { Button }
78- variant = "outline-primary"
79- aria-label = { intl . formatMessage ( messages . moreActionsButtonAriaLabel ) }
80- >
81- < Icon src = { ViewSidebar } />
82- </ Dropdown . Toggle >
83- < Dropdown . Menu className = "mt-1" >
84- { Object . entries ( sidebarPages ) . filter ( ( [ , page ] ) => ! page . hideFromActionMenu )
85- . map ( ( [ key , page ] : [ OutlineSidebarPageKeys , SidebarPage ] ) => (
86- < Dropdown . Item
87- key = { key }
88- onClick = { ( ) => setCurrentPageKey ( key ) }
89- >
90- < Stack direction = "horizontal" gap = { 2 } >
91- < Icon src = { page . icon } />
92- { intl . formatMessage ( page . title ) }
93- </ Stack >
94- </ Dropdown . Item >
95- ) ) }
96- </ Dropdown . Menu >
97- </ Dropdown >
98-
9987 </ Stack >
10088 ) ;
10189} ;
0 commit comments