Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Add exercise page path as constant #2403

Merged
merged 2 commits into from
Oct 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/LessonTabs/LessonTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { CURRICULUM_PATH } from '../../constants'
import { CURRICULUM_PATH, EXERCISES_PATH } from '../../constants'
import NavCard from '../NavCard'

type Lesson = {
Expand All @@ -24,7 +24,7 @@ const LessonTabs = ({ lesson, activeTab }: Props) => {
const tabs = [
...(lesson.docUrl ? [{ text: 'lesson', url: lesson.docUrl }] : []),
{ text: 'challenges', url: `${CURRICULUM_PATH}/${lesson.slug}` },
{ text: 'exercises', url: `/exercises/${lesson.slug}` },
{ text: 'exercises', url: `${EXERCISES_PATH}/${lesson.slug}` },
{
text: 'mentor exercises',
url: `${CURRICULUM_PATH}/${lesson.slug}/mentor`
Expand Down
1 change: 1 addition & 0 deletions constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const DOCS_PATH = '/docs'
export const DISCORD_PATH = 'https://discord.gg/c0d3'
export const LOGIN_PATH = '/login'
export const SIGNUP_PATH = '/signup'
export const EXERCISES_PATH = '/exercises'

// Color
export const PRIMARY_COLOR_HEX = '#5440d8'
Expand Down