Skip to content

Commit 2e81f5e

Browse files
tmp
1 parent ec86950 commit 2e81f5e

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

frontends/main/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@sentry/nextjs": "^8.36.0",
2323
"@tanstack/react-query": "^4.36.1",
2424
"api": "workspace:*",
25+
"classnames": "^2.5.1",
2526
"formik": "^2.4.6",
2627
"iso-639-1": "^3.1.4",
2728
"lodash": "^4.17.21",

frontends/main/src/page-components/LearningResourceDrawer/LearningResourceExpanded.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ import {
2020
} from "@mitodl/smoot-design"
2121
import type { LearningResource } from "api"
2222
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"
2428
import {
2529
RiBookmarkFill,
2630
RiBookmarkLine,
@@ -32,11 +36,13 @@ import {
3236
RiMenuAddLine,
3337
RiShareLine,
3438
RiTwitterXLine,
39+
RiSparkling2Line,
3540
} from "@remixicon/react"
3641

3742
import InfoSection from "./InfoSection"
3843
import type { User } from "api/hooks/user"
3944
import VideoFrame from "./VideoFrame"
45+
import classNames from "classnames"
4046

4147
const DRAWER_WIDTH = "900px"
4248

@@ -735,14 +741,18 @@ const LearningResourceExpanded: React.FC<LearningResourceExpandedProps> = ({
735741
onAddToUserListClick,
736742
closeDrawer,
737743
}) => {
744+
const [showTutor, setShowTutor] = useToggle(false)
738745
const outerContainerRef = useRef<HTMLDivElement>(null)
739746
useEffect(() => {
740747
if (outerContainerRef.current && outerContainerRef.current.scrollTo) {
741748
outerContainerRef.current.scrollTo(0, 0)
742749
}
743750
}, [resourceId])
744751
return (
745-
<Outer className="tutor-enabled" ref={outerContainerRef}>
752+
<Outer
753+
className={classNames({ "tutor-enabled": showTutor })}
754+
ref={outerContainerRef}
755+
>
746756
<TitleSection
747757
titleId={titleId}
748758
resource={resource}
@@ -767,6 +777,15 @@ const LearningResourceExpanded: React.FC<LearningResourceExpandedProps> = ({
767777
onAddToLearningPathClick={onAddToLearningPathClick}
768778
onAddToUserListClick={onAddToUserListClick}
769779
/>
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+
)}
770789
</ContentRight>
771790
</ContentContainer>
772791
{topCarousels && (

yarn.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)