generated from openedx/frontend-template-application
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: updating modules to match the new format from frontend-base
- Loading branch information
Showing
19 changed files
with
410 additions
and
108 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { default as moduleOneConfig } from './module-one'; | ||
export { default as moduleThreeConfig } from './module-three'; | ||
export { default as moduleTwoConfig } from './module-two'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,24 @@ | ||
import { getConfig } from '@openedx/frontend-base'; | ||
import { Container } from '@openedx/paragon'; | ||
import { Link, Route, Routes } from 'react-router-dom'; | ||
import { Link, Outlet } from 'react-router-dom'; | ||
|
||
import './moduleOne.css'; | ||
|
||
const ModuleOne = () => ( | ||
<main> | ||
<Container className="py-5"> | ||
<h1>Module One</h1> | ||
<h1 className="one">Module One</h1> | ||
<p>This module is acting as a homepage because it was mounted at the root.</p> | ||
<p>The site's name is {getConfig().SITE_NAME}!</p> | ||
<ul> | ||
<li><Link to="child">View the child page content</Link></li> | ||
<li><Link to="/two">View Module Two</Link></li> | ||
<li><Link to="/three">View Module THree</Link></li> | ||
<li><Link to="/three">View Module Three</Link></li> | ||
</ul> | ||
<Routes> | ||
<Route path="child" element={ | ||
<div>You're viewing the content of the child page at /child</div> | ||
}/> | ||
</Routes> | ||
<Outlet /> | ||
<p>Module one content after the outlet.</p> | ||
</Container> | ||
</main> | ||
); | ||
|
||
export default ModuleOne; | ||
|
||
export const config = { | ||
path: 'one', | ||
component: ModuleOne, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function ModuleOneChild() { | ||
return ( | ||
<div>You're viewing the content of the child page at /child</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ApplicationModuleConfig, HeaderTypes } from "@openedx/frontend-base"; | ||
|
||
const config: ApplicationModuleConfig = { | ||
routes: [ | ||
{ | ||
path: '/', | ||
lazy: async () => { | ||
const { default: Component } = await import('./ModuleOne'); | ||
return { | ||
Component, | ||
handle: { | ||
headerId: HeaderTypes.DEFAULT, | ||
} | ||
} | ||
}, | ||
children: [ | ||
{ | ||
path: 'child', | ||
lazy: async () => { | ||
const { default: Component } = await import('./ModuleOneChild'); | ||
return { | ||
Component, | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
h1.one { | ||
color: red; | ||
text-decoration: underline wavy; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Container } from '@openedx/paragon'; | ||
import { Link, Outlet } from 'react-router-dom'; | ||
|
||
import './moduleThree.scss'; | ||
|
||
export default function ModuleThree() { | ||
return ( | ||
<main> | ||
<Container className="py-5"> | ||
<h1 className="three">Module Three</h1> | ||
<ul> | ||
<li><Link to="child">View the Module Three child page content</Link></li> | ||
<li><Link to="/">View Module One</Link></li> | ||
<li><Link to="/two">View Module Two</Link></li> | ||
</ul> | ||
<Outlet /> | ||
<p>Module three content after the outlet.</p> | ||
</Container> | ||
</main> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function ModuleThreeChild() { | ||
return ( | ||
<div>You're viewing the content of the module three child page at /child</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ApplicationModuleConfig, HeaderTypes } from "@openedx/frontend-base"; | ||
|
||
const config: ApplicationModuleConfig = { | ||
routes: [ | ||
{ | ||
path: 'three', | ||
lazy: async () => { | ||
const { default: Component } = await import('./ModuleThree'); | ||
return { | ||
Component, | ||
handle: { | ||
headerId: HeaderTypes.STUDIO, | ||
} | ||
} | ||
}, | ||
children: [ | ||
{ | ||
path: 'child', | ||
lazy: async () => { | ||
const { default: Component } = await import('./ModuleThreeChild'); | ||
return { | ||
Component, | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
h1.three { | ||
color: green; | ||
text-decoration: underline double; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
import { Container } from '@openedx/paragon'; | ||
import { Link, Route, Routes } from 'react-router-dom'; | ||
import { Link, Outlet } from 'react-router-dom'; | ||
|
||
import './moduleTwo.scss'; | ||
|
||
const ModuleTwo = () => ( | ||
<main> | ||
<Container className="py-5"> | ||
<h1>Module Two</h1> | ||
<h1 className="two">Module Two</h1> | ||
<ul> | ||
<li><Link to="child">View the Module Two child page content</Link></li> | ||
<li><Link to="/">View Module One</Link></li> | ||
<li><Link to="/three">View Module Three</Link></li> | ||
</ul> | ||
<Routes> | ||
<Route path="child" element={ | ||
<div>You're viewing the child page of Module Two.</div> | ||
} /> | ||
</Routes> | ||
<Outlet /> | ||
<p>Module two content after the outlet.</p> | ||
</Container> | ||
</main> | ||
); | ||
|
||
export default ModuleTwo; | ||
|
||
export const config = { | ||
path: 'two', | ||
component: ModuleTwo, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function ModuleTwoChild() { | ||
return ( | ||
<div>You're viewing the content of the module two child page at /child</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { ApplicationModuleConfig, HeaderTypes } from "@openedx/frontend-base"; | ||
|
||
const config: ApplicationModuleConfig = { | ||
routes: [ | ||
{ | ||
path: 'two', | ||
lazy: async () => { | ||
const { default: Component } = await import('./ModuleTwo'); | ||
return { | ||
Component, | ||
handle: { | ||
headerId: HeaderTypes.LEARNING, | ||
} | ||
} | ||
}, | ||
children: [ | ||
{ | ||
path: 'child', | ||
lazy: async () => { | ||
const { default: Component } = await import('./ModuleTwoChild'); | ||
return { | ||
Component, | ||
handle: { | ||
headerId: HeaderTypes.DEFAULT | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
], | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
h1.two { | ||
color: blue; | ||
text-decoration: underline dashed; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters