Skip to content

Commit

Permalink
Merge pull request #2393 from flacial/2029-dojomentorpage-list-mentor…
Browse files Browse the repository at this point in the history
…-submitted-exercises/4

feat(DOJO): Add back button to addExercise page
  • Loading branch information
flacial authored Oct 3, 2022
2 parents cf10813 + 6c30d4a commit 235486f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pages/curriculum/[lessonSlug]/mentor/addExercise/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import styles from '../../../../../scss/mentorPage.module.scss'
import { get } from 'lodash'
import QueryInfo from '../../../../../components/QueryInfo'
import { errorCheckAllFields } from '../../../../../helpers/admin/adminHelpers'
import { ArrowLeftIcon } from '@primer/octicons-react'
import Link from 'next/link'
import * as Sentry from '@sentry/nextjs'

type DetachedModule = Omit<Module, 'lesson' | 'author'>
Expand All @@ -43,10 +45,18 @@ const Header = <
setModule,
setErrorMsg
}: HeaderProps<T>) => {
const { query } = useRouter()
const { lessonSlug } = query

const modules = get(lesson, 'modules') ?? []

return (
<header className={styles.header}>
<Link href={`/curriculum/${lessonSlug}/mentor`}>
<a className="btn ps-0 d-flex align-items-center mb-3">
<ArrowLeftIcon size="medium" aria-label="Exit" />
</a>
</Link>
<div>
<h1>{get(lesson, 'title')}</h1>
</div>
Expand Down Expand Up @@ -133,8 +143,8 @@ const initValues = [
]

const AddExercisePage = ({ data }: GetAppProps) => {
const router = useRouter()
const { lessonSlug } = router.query
const { query } = useRouter()
const { lessonSlug } = query

// Omitting author and lesson because data.lessons[i].modules[i] mismatching type
const [module, setModule] = useState<null | DetachedModule>(null)
Expand Down

1 comment on commit 235486f

@vercel
Copy link

@vercel vercel bot commented on 235486f Oct 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.