Skip to content

Commit

Permalink
Added a new question page
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurenko committed Sep 10, 2023
1 parent ae49688 commit 1e6ee89
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/constants/translations/en/breadcrumbs.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"chat": "Chat",
"myOffers": "My offers",
"editLesson": "Edit lesson",
"lessonDetails": "Lesson details"
"lessonDetails": "Lesson details",
"newQuestion": "New question"
}
3 changes: 2 additions & 1 deletion src/constants/translations/ua/breadcrumbs.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"chat": "Чат",
"myOffers": "Мої пропозиції",
"editLesson": "Редагування уроку",
"lessonDetails": "Деталі уроку"
"lessonDetails": "Деталі уроку",
"newQuestion": "Нове питання"
}
11 changes: 11 additions & 0 deletions src/pages/create-or-edit-question/CreateOrEditQuestion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import PageWrapper from '~/components/page-wrapper/PageWrapper'

const CreateOrEditQuestion = () => {
return (
<PageWrapper>
<div>CreateOrEditQuestion</div>
</PageWrapper>
)
}

export default CreateOrEditQuestion
4 changes: 4 additions & 0 deletions src/router/constants/authRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export const authRoutes = {
editLesson: {
route: 'my-resources/edit-lesson/:id',
path: '/my-resources/edit-lesson'
},
newQuestion: {
route: 'my-resources/new-question',
path: '/my-resources/new-question'
}
},
lessonDetails: { route: 'lesson-details/:id', path: '/lesson-details' },
Expand Down
5 changes: 5 additions & 0 deletions src/router/constants/crumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,8 @@ export const chat = {
name: t('breadCrumbs.chat'),
path: authRoutes.chat.route
}

export const newQuestion = {
name: t('breadCrumbs.newQuestion'),
path: authRoutes.myResources.newQuestion.route
}
11 changes: 10 additions & 1 deletion src/router/routes/authRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {
newLesson,
offerDetails,
subjects,
userProfile
userProfile,
newQuestion
} from '~/router/constants/crumbs'
import PrivateRoute from '~/router/helpers/PrivateRoute'
import { UserRoleEnum } from '~/types'
Expand All @@ -38,6 +39,9 @@ const CreateOrEditLesson = lazy(
() => import('~/pages/create-or-edit-lesson/CreateOrEditLesson')
)
const LessonDetails = lazy(() => import('~/pages/lesson-details/LessonDetails'))
const CreateOrEditQuestion = lazy(
() => import('~/pages/create-or-edit-question/CreateOrEditQuestion')
)

export const authRouter = (
<Route
Expand Down Expand Up @@ -114,5 +118,10 @@ export const authRouter = (
handle={{ crumb: [myResources, lessonDetails] }}
path={authRoutes.lessonDetails.route}
/>
<Route
element={<CreateOrEditQuestion />}
handle={{ crumb: [myResources, newQuestion] }}
path={authRoutes.myResources.newQuestion.route}
/>
</Route>
)

0 comments on commit 1e6ee89

Please sign in to comment.