Skip to content
This repository was archived by the owner on Mar 7, 2024. It is now read-only.

Commit adeac91

Browse files
committed
shift courses to nested location
1 parent 3ff5e80 commit adeac91

File tree

9 files changed

+45
-84
lines changed

9 files changed

+45
-84
lines changed

src/Routes.js

Lines changed: 3 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,7 @@ import HomeView from 'src/views/pages/HomeView';
77
import CAView from 'src/views/pages/CLView';
88
import EventsView from 'src/views/pages/EventsView';
99
import LoadingScreen from 'src/components/LoadingScreen';
10-
import MachineLearningView from 'src/views/pages/Courses/MachineLearningView'
11-
import AlgoJavaView from 'src/views/pages/Courses/AlgoJavaView'
12-
import AlgoPythonView from 'src/views/pages/Courses/AlgoPythonView'
13-
import WebFullStakView from 'src/views/pages/Courses/WebFullStakView'
14-
import CompetitiveJavaView from 'src/views/pages/Courses/CompetitiveJavaView'
15-
import PythonDevelopmentView from 'src/views/pages/Courses/PythonDevelopmentView'
16-
import CoursesView from 'src/views/pages/CoursesView';
10+
import Courses from 'src/views/pages/Courses';
1711
import ProfileView from 'src/views/pages/ProfileView'
1812
import ApplicationsView from 'src/views/pages/ApplicationsView'
1913

@@ -102,7 +96,7 @@ const routesConfig = [
10296
{
10397
exact: true,
10498
path: '/courses',
105-
component: CoursesView
99+
component: Courses
106100
},
107101
{
108102
component: () => <Redirect to="/404" />
@@ -136,72 +130,7 @@ const routesConfig = [
136130
}
137131
]
138132
},
139-
{
140-
path: '/machine-learning-using-python',
141-
layout: MainLayout,
142-
routes: [
143-
{
144-
exact: true,
145-
path: '/machine-learning-using-python',
146-
component: MachineLearningView
147-
}
148-
]
149-
},
150-
{
151-
path: '/ds-algo-with-java',
152-
layout: MainLayout,
153-
routes: [
154-
{
155-
exact: true,
156-
path: '/ds-algo-with-java',
157-
component: AlgoJavaView
158-
}
159-
]
160-
},
161-
{
162-
path: '/ds-algo-with-python',
163-
layout: MainLayout,
164-
routes: [
165-
{
166-
exact: true,
167-
path: '/ds-algo-with-python',
168-
component: AlgoPythonView
169-
}
170-
]
171-
},
172-
{
173-
path: '/fullstack-webdev-with-js',
174-
layout: MainLayout,
175-
routes: [
176-
{
177-
exact: true,
178-
path: '/fullstack-webdev-with-js',
179-
component: WebFullStakView
180-
}
181-
]
182-
},
183-
{
184-
path: '/competitive-programming-using-java',
185-
layout: MainLayout,
186-
routes: [
187-
{
188-
exact: true,
189-
path: '/competitive-programming-using-java',
190-
component: CompetitiveJavaView
191-
}
192-
]
193-
},
194-
{
195-
path: '/application-dev-using-python',
196-
layout: MainLayout,
197-
routes: [
198-
{
199-
exact: true,
200-
path: '/application-dev-using-python',
201-
component: PythonDevelopmentView
202-
}
203-
]
204-
},
133+
205134
{
206135
path: '*',
207136
layout: MainLayout,

src/data/courses/advanced/CompetitiveJava.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const competitiveJava = {
22
difficulty: 'Intermediate',
33
duration: '30 Lectures',
44
level: 'Level 2',
5-
link: '/competitive-programming-using-java',
5+
link: '/courses/competitive-programming-using-java',
66
domain: 'Interview Prepration',
77
title: 'Competitve Programming using Java',
88
upcoming: 'Oct 1st',

src/data/courses/advanced/MachineLearning.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const machineLearning = {
22
difficulty: 'Intermediate',
33
duration: '30 Lectures',
44
level: 'Level 2',
5-
link: '/machine-learning-using-python',
5+
link: '/courses/machine-learning-using-python',
66
domain: 'Artificial Intelligence',
77
title: 'Master Machine Learning using Python',
88
upcoming: 'Oct 1st',

src/data/courses/advanced/WebDevelopment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const webDevelopment = {
22
difficulty: 'Intermediate',
33
duration: '30 Lectures',
44
level: 'Level 2',
5-
link: '/fullstack-webdev-with-js',
5+
link: '/courses/fullstack-webdev-with-js',
66
domain: 'Web Development',
77
title: 'Full Stack Web Development with JS',
88
upcoming: 'Oct 1st',

src/data/courses/foundation/AlgoJava.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const algoJava = {
22
difficulty: 'Foundation',
33
duration: '30 Lectures',
44
level: 'Level 1',
5-
link: '/ds-algo-with-java',
5+
link: '/courses/ds-algo-with-java',
66
domain: 'Algorithms',
77
title: 'Data Structure and Algorithms with Java',
88
upcoming: 'Oct 1st',

src/data/courses/foundation/AlgoPython.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const algoPython = {
22
difficulty: 'Foundation',
33
duration: '30 Lectures',
44
level: 'Level 1',
5-
link: '/ds-algo-with-python',
5+
link: '/courses/ds-algo-with-python',
66
domain: 'Algorithms',
77
title: 'Data Structure and Algorithms with Python',
88
upcoming: 'Oct 1st',

src/data/courses/foundation/DevPython.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const devPython = {
22
difficulty: 'Foundation',
33
duration: '24 Lectures',
44
level: 'Level 1',
5-
link: '/application-dev-using-python',
5+
link: '/courses/application-dev-using-python',
66
domain: 'Development',
77
title: 'Application Development with Python',
88
upcoming: 'Oct 1st',

src/views/pages/ApplicationsView/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ import React from 'react';
22
import { EditApplication } from './EditApplication';
33

44
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
5+
import CoursesView from '../CoursesView';
56

67
function ApplicationsView({ match }) {
7-
8-
console.log("Matched in routing", match);
8+
console.log('Matched in routing', match);
99

1010
return (
1111
<Router>
12-
<Switch>
13-
<Route path={`${match.path}/edit`} component={EditApplication}/>
12+
<Switch>
13+
<Route path={`${match.path}/edit`} component={EditApplication} />
14+
<Route path={`${match.path}/`} component={CoursesView} />
1415
</Switch>
1516
</Router>
1617
);

src/views/pages/Courses/index.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from 'react';
2+
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
3+
import CoursesView from '../CoursesView';
4+
5+
import MachineLearningView from 'src/views/pages/Courses/MachineLearningView'
6+
import AlgoJavaView from 'src/views/pages/Courses/AlgoJavaView'
7+
import AlgoPythonView from 'src/views/pages/Courses/AlgoPythonView'
8+
import WebFullStakView from 'src/views/pages/Courses/WebFullStakView'
9+
import CompetitiveJavaView from 'src/views/pages/Courses/CompetitiveJavaView'
10+
import PythonDevelopmentView from 'src/views/pages/Courses/PythonDevelopmentView'
11+
12+
13+
function ApplicationsView({ match }) {
14+
console.log('Matched in routing', match);
15+
16+
return (
17+
<Router>
18+
<Switch>
19+
<Route path={`${match.path}/machine-learning-using-python`} component={MachineLearningView} />
20+
<Route path={`${match.path}/ds-algo-with-java`} component={AlgoJavaView} />
21+
<Route path={`${match.path}/ds-algo-with-python`} component={AlgoPythonView} />
22+
<Route path={`${match.path}/fullstack-webdev-with-js`} component={WebFullStakView} />
23+
<Route path={`${match.path}/competitive-programming-using-java`} component={CompetitiveJavaView} />
24+
<Route path={`${match.path}/application-dev-using-python`} component={PythonDevelopmentView} />
25+
<Route path={`${match.path}/`} component={CoursesView} />
26+
</Switch>
27+
</Router>
28+
);
29+
}
30+
31+
export default ApplicationsView;

0 commit comments

Comments
 (0)