-
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.
revert to less declarative routing #13
* avoid having to forcefully require components * avoid namespace/path collisions more elegantly * make ordering pages (regarding navbar) easily feasable
- Loading branch information
1 parent
25eff2a
commit ea58e75
Showing
6 changed files
with
46 additions
and
63 deletions.
There are no files selected for viewing
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 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 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,28 +1,21 @@ | ||
import { Divider, List } from '@material-ui/core'; | ||
import * as React from 'react'; | ||
import { RouteComponentProps } from 'react-router'; | ||
import { Routed } from 'elite-routing'; | ||
import { AppPaths } from '../../util/routes'; | ||
import { LinkListItem } from '../general/LinkListItem'; | ||
import { LinkDirectory } from './support/LinkDirectory'; | ||
|
||
export interface LinkPageProps extends RouteComponentProps {} | ||
|
||
@Routed({ path: AppPaths.LINK, displayName: 'Useful Links' }) | ||
export class LinkPage extends React.PureComponent<LinkPageProps> { | ||
render() { | ||
return ( | ||
<> | ||
<h1>Useful Links List</h1> | ||
<List> | ||
<LinkListItem href={'https://elite-se.informatik.uni-augsburg.de'} title={'Main Webpage'} /> | ||
<LinkListItem href={'https://github.com/elite-se/elite-se.protokolle'} title={'Exam Protocols'} /> | ||
</List> | ||
export const LinkPage = (props: LinkPageProps) => ( | ||
<> | ||
<h1>Useful Links List</h1> | ||
<List> | ||
<LinkListItem href={'https://elite-se.informatik.uni-augsburg.de'} title={'Main Webpage'} /> | ||
<LinkListItem href={'https://github.com/elite-se/elite-se.protokolle'} title={'Exam Protocols'} /> | ||
</List> | ||
|
||
<Divider /> | ||
<Divider /> | ||
|
||
<LinkDirectory /> | ||
</> | ||
); | ||
} | ||
} | ||
<LinkDirectory /> | ||
</> | ||
); |
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,22 @@ | ||
import * as React from 'react'; | ||
import { HomePage } from '../components/pages/HomePage'; | ||
import { LinkPage } from '../components/pages/LinkPage'; | ||
import { registerAppRoute } from 'elite-routing'; | ||
|
||
export enum AppPaths { | ||
HOME = '/home', | ||
LINK = '/link', | ||
} | ||
|
||
export function registerRoutes() { | ||
registerAppRoute({ | ||
path: AppPaths.HOME, | ||
displayName: 'Home', | ||
render: props => <HomePage {...props} />, | ||
}); | ||
registerAppRoute({ | ||
path: AppPaths.LINK, | ||
displayName: 'Useful Links', | ||
render: props => <LinkPage {...props} />, | ||
}); | ||
} |
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