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

Commit

Permalink
feat(labs): adds labs route
Browse files Browse the repository at this point in the history
  • Loading branch information
jackcmeyer committed Apr 3, 2020
1 parent d1f78c4 commit a9c4100
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 22 deletions.
2 changes: 2 additions & 0 deletions src/HospitalRun.tsx
Expand Up @@ -9,6 +9,7 @@ import ViewAppointment from 'scheduling/appointments/view/ViewAppointment'
import Breadcrumbs from 'breadcrumbs/Breadcrumbs'
import { ButtonBarProvider } from 'page-header/ButtonBarProvider'
import ButtonToolBar from 'page-header/ButtonToolBar'
import Labs from 'labs/Labs'
import Sidebar from './components/Sidebar'
import Permissions from './model/Permissions'
import Dashboard from './dashboard/Dashboard'
Expand Down Expand Up @@ -99,6 +100,7 @@ const HospitalRun = () => {
path="/appointments/:id"
component={ViewAppointment}
/>
<PrivateRoute isAuthenticated exact path="/labs" component={Labs} />
</Switch>
</div>
<Toaster autoClose={5000} hideProgressBar draggable />
Expand Down
30 changes: 8 additions & 22 deletions src/components/Sidebar.tsx
Expand Up @@ -164,28 +164,14 @@ const Sidebar = () => {
/>
<Icon icon="appointment" /> {!sidebarCollapsed && t('scheduling.label')}
</ListItem>
{splittedPath[1].includes('appointment') && expandedItem === 'appointment' && (
<List layout="flush" className="nav flex-column">
<ListItem
className="nav-item"
style={listSubItemStyleNew}
onClick={() => navigateTo('/appointments/new')}
active={splittedPath[1].includes('appointments') && splittedPath.length > 2}
>
<Icon icon="appointment-add" style={iconMargin} />
{!sidebarCollapsed && t('scheduling.appointments.new')}
</ListItem>
<ListItem
className="nav-item"
style={listSubItemStyle}
onClick={() => navigateTo('/appointments')}
active={splittedPath[1].includes('appointments') && splittedPath.length < 3}
>
<Icon icon="incident" style={iconMargin} />
{!sidebarCollapsed && t('scheduling.appointments.schedule')}
</ListItem>
</List>
)}
<ListItem
active={pathname.split('/')[1].includes('labs')}
onClick={() => navigateTo('/labs')}
className="nav-item"
style={listItemStyle}
>
<Icon icon="lab" /> {!sidebarCollapsed && t('labs.label')}
</ListItem>
</List>
</div>
</nav>
Expand Down
12 changes: 12 additions & 0 deletions src/labs/Labs.tsx
@@ -0,0 +1,12 @@
import React from 'react'
import PrivateRoute from 'components/PrivateRoute'
import { Switch } from 'react-router'
import LabRequests from './requests/LabRequests'

const Labs = () => (
<Switch>
<PrivateRoute isAuthenticated exact path="/labs" component={LabRequests} />
</Switch>
)

export default Labs
12 changes: 12 additions & 0 deletions src/labs/requests/LabRequests.tsx
@@ -0,0 +1,12 @@
import React from 'react'
import useTitle from 'page-header/useTitle'
import { useTranslation } from 'react-i18next'

const LabRequests = () => {
const { t } = useTranslation()
useTitle(t('labs.requests.label'))

return <h1>Lab Requests</h1>
}

export default LabRequests
2 changes: 2 additions & 0 deletions src/locales/enUs/translations/index.ts
Expand Up @@ -5,6 +5,7 @@ import patients from './patients'
import scheduling from './scheduling'
import states from './states'
import sex from './sex'
import labs from './labs'

export default {
...actions,
Expand All @@ -14,4 +15,5 @@ export default {
...scheduling,
...states,
...sex,
...labs,
}
8 changes: 8 additions & 0 deletions src/locales/enUs/translations/labs/index.ts
@@ -0,0 +1,8 @@
export default {
labs: {
label: 'Labs',
requests: {
label: 'Lab Requests',
},
},
}

0 comments on commit a9c4100

Please sign in to comment.