-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Product Files - Step 2: Add Files route
- Loading branch information
Showing
5 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
source/SIL.AppBuilder.Portal.Frontend/src/ui/routes/files/index.tsx
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,20 @@ | ||
import * as React from 'react'; | ||
import { Switch } from 'react-router-dom'; | ||
|
||
import { Route } from '~/lib/routing'; | ||
|
||
import { NotFound } from '@ui/routes/errors'; | ||
|
||
import FilesShowRoute, { pathName as filesShowPath } from './show'; | ||
|
||
export default function FilesRoute() { | ||
return ( | ||
<div className='ui container'> | ||
<Switch> | ||
<Route path={filesShowPath} component={FilesShowRoute} /> | ||
|
||
<Route component={NotFound} /> | ||
</Switch> | ||
</div> | ||
); | ||
} |
20 changes: 20 additions & 0 deletions
20
source/SIL.AppBuilder.Portal.Frontend/src/ui/routes/files/show/display.tsx
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,20 @@ | ||
import * as React from 'react'; | ||
import { useTranslations } from '@lib/i18n'; | ||
|
||
import { useRouter } from '~/lib/hooks'; | ||
|
||
export interface Params { | ||
id: string; | ||
} | ||
|
||
export default function FilesShowDisplay() { | ||
const { t } = useTranslations(); | ||
const { match } = useRouter(); | ||
const { | ||
params: { id }, | ||
} = match; | ||
|
||
return ( | ||
<div className='flex flex-column h-100 align-items-center justify-content-center'>{id}</div> | ||
); | ||
} |
13 changes: 13 additions & 0 deletions
13
source/SIL.AppBuilder.Portal.Frontend/src/ui/routes/files/show/index.tsx
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,13 @@ | ||
import { compose } from 'recompose'; | ||
import { withCurrentUserContext } from '@data/containers/with-current-user'; | ||
import { withTranslations } from '@lib/i18n'; | ||
|
||
import Display from './display'; | ||
|
||
export const pathName = '/files/:id'; | ||
|
||
export default compose( | ||
withTranslations, | ||
withCurrentUserContext | ||
// todo - extract this to a more general thing? | ||
)(Display); |
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