@@ -20,7 +20,11 @@ import {
20
20
} from "@mitodl/smoot-design"
21
21
import type { LearningResource } from "api"
22
22
import { ResourceTypeEnum , PlatformEnum } from "api"
23
- import { DEFAULT_RESOURCE_IMG , getReadableResourceType } from "ol-utilities"
23
+ import {
24
+ DEFAULT_RESOURCE_IMG ,
25
+ getReadableResourceType ,
26
+ useToggle ,
27
+ } from "ol-utilities"
24
28
import {
25
29
RiBookmarkFill ,
26
30
RiBookmarkLine ,
@@ -32,11 +36,13 @@ import {
32
36
RiMenuAddLine ,
33
37
RiShareLine ,
34
38
RiTwitterXLine ,
39
+ RiSparkling2Line ,
35
40
} from "@remixicon/react"
36
41
37
42
import InfoSection from "./InfoSection"
38
43
import type { User } from "api/hooks/user"
39
44
import VideoFrame from "./VideoFrame"
45
+ import classNames from "classnames"
40
46
41
47
const DRAWER_WIDTH = "900px"
42
48
@@ -735,14 +741,18 @@ const LearningResourceExpanded: React.FC<LearningResourceExpandedProps> = ({
735
741
onAddToUserListClick,
736
742
closeDrawer,
737
743
} ) => {
744
+ const [ showTutor , setShowTutor ] = useToggle ( false )
738
745
const outerContainerRef = useRef < HTMLDivElement > ( null )
739
746
useEffect ( ( ) => {
740
747
if ( outerContainerRef . current && outerContainerRef . current . scrollTo ) {
741
748
outerContainerRef . current . scrollTo ( 0 , 0 )
742
749
}
743
750
} , [ resourceId ] )
744
751
return (
745
- < Outer className = "tutor-enabled" ref = { outerContainerRef } >
752
+ < Outer
753
+ className = { classNames ( { "tutor-enabled" : showTutor } ) }
754
+ ref = { outerContainerRef }
755
+ >
746
756
< TitleSection
747
757
titleId = { titleId }
748
758
resource = { resource }
@@ -767,6 +777,15 @@ const LearningResourceExpanded: React.FC<LearningResourceExpandedProps> = ({
767
777
onAddToLearningPathClick = { onAddToLearningPathClick }
768
778
onAddToUserListClick = { onAddToUserListClick }
769
779
/>
780
+ { showTutor ? null : (
781
+ < Button
782
+ onClick = { setShowTutor . on }
783
+ variant = "secondary"
784
+ endIcon = { < RiSparkling2Line /> }
785
+ >
786
+ Need help? Ask our Tutor.
787
+ </ Button >
788
+ ) }
770
789
</ ContentRight >
771
790
</ ContentContainer >
772
791
{ topCarousels && (
0 commit comments