Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat: added route for visualize component and performed sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
yosephAHMED committed Aug 12, 2020
1 parent a105748 commit 9dc7855
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/incidents/Incidents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { RootState } from '../shared/store'
import ViewIncidents from './list/ViewIncidents'
import ReportIncident from './report/ReportIncident'
import ViewIncident from './view/ViewIncident'
import VisualizeIncidents from './visualize/VisualizeIncidents'

const Incidents = () => {
const { permissions } = useSelector((state: RootState) => state.user)
Expand All @@ -34,6 +35,12 @@ const Incidents = () => {
path="/incidents/new"
component={ReportIncident}
/>
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.ViewIncidentWidgets)}
exact
path="/incidents/visualize"
component={VisualizeIncidents}
/>
<PrivateRoute
isAuthenticated={permissions.includes(Permissions.ViewIncident)}
exact
Expand Down
31 changes: 31 additions & 0 deletions src/incidents/visualize/VisualizeIncidents.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {} from '@hospitalrun/components'
import React from 'react'
// import { useDispatch, useSelector } from 'react-redux'
// import { useParams, useHistory } from 'react-router-dom'

// import useAddBreadcrumbs from '../../page-header/breadcrumbs/useAddBreadcrumbs'
// import useTitle from '../../page-header/title/useTitle'
// import useTranslator from '../../shared/hooks/useTranslator'
// import { RootState } from '../../shared/store'

const VisualizeIncidents = () => (
// const dispatch = useDispatch()
// const { t } = useTranslator()
// const history = useHistory()
// const { id } = useParams()
// const { incident } = useSelector((state: RootState) => state.incident)
// useTitle(incident ? incident.code : '')
// const breadcrumbs = [
// {
// i18nKey: incident ? incident.code : '',
// location: `/incidents/${id}`,
// },
// ]
// useAddBreadcrumbs(breadcrumbs)

<>
<h1>Hello from VisualizeIncidents.tsx!</h1>
</>
)

export default VisualizeIncidents

0 comments on commit 9dc7855

Please sign in to comment.