Skip to content

Commit 673edd3

Browse files
authored
Merge pull request #6 from helpwave/page-content
feat: add patients table
2 parents 3765a27 + b29df57 commit 673edd3

File tree

8 files changed

+220
-467
lines changed

8 files changed

+220
-467
lines changed

web/components/layout/Page.tsx

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import Link from 'next/link'
88
import {
99
Dialog,
1010
ExpansionIcon,
11-
HelpwaveLogo,
11+
HelpwaveLogo, IconButton, Input,
1212
MarkdownInterpreter,
1313
SolidButton,
1414
useLocalStorage
1515
} from '@helpwave/hightide'
1616
import { getConfig } from '@/utils/config'
1717
import { useTasksTranslation } from '@/i18n/useTasksTranslation'
1818
import clsx from 'clsx'
19-
import { CircleCheck, Grid2X2PlusIcon, User } from 'lucide-react'
19+
import { BellIcon, CircleCheck, Grid2X2PlusIcon, SettingsIcon, User } from 'lucide-react'
2020
import { usePathname } from 'next/navigation'
2121

2222
export const StagingDisclaimerDialog = () => {
@@ -74,25 +74,26 @@ type HeaderProps = HTMLAttributes<HTMLHeadElement>
7474
* The basic header for most pages
7575
*/
7676
export const Header = ({ ...props }: HeaderProps) => {
77+
const translation = useTasksTranslation()
78+
7779
return (
7880
<header
7981
{...props}
8082
className={clsx(
81-
'flex-row-8 items-center justify-between grow max-h-18 p-4 bg-header-background text-header-text shadow-md rounded-lg',
83+
'flex-row-8 items-center justify-between',
8284
props.className
8385
)}
8486
>
85-
<div className="flex grow-1">
86-
<Link href="/" className="flex-row-2 bg-surface text-on-surface items-center rounded-lg p-2">
87-
<HelpwaveLogo className="min-h-7 min-w-7 p-0.5 bg-header-background rounded-md"/>
88-
<span className="typography-title-md whitespace-nowrap">{'helpwave tasks'}</span>
89-
</Link>
87+
<div className="flex-col-0">
88+
<Input placeholder={translation('search')}/>
9089
</div>
91-
<div className="flex-col-0 grow-1 justify-center items-center">
92-
<span className="typography-title-md">{'TK'}</span>
93-
<span className="text-description">{'Test Klinkum'}</span>
94-
</div>
95-
<div className="flex-row-0 grow-1 justify-end">
90+
<div className="flex-row-4 justify-end">
91+
<IconButton color="neutral">
92+
<BellIcon />
93+
</IconButton>
94+
<IconButton color="neutral">
95+
<SettingsIcon />
96+
</IconButton>
9697
<SolidButton color="neutral">
9798
{'User Name'}
9899
<ExpansionIcon isExpanded={false}/>
@@ -127,8 +128,8 @@ const SidebarLink = ({ children, route, ...props }: SidebarLinkProps) => {
127128
<Link
128129
{...props}
129130
className={clsx(
130-
'flex-row-2 w-full px-2.5 py-1.5 rounded-md hover:bg-white/50 dark:hover:bg-black/50',
131-
{ 'bg-white dark:bg-black': route === props.href }
131+
'flex-row-2 w-full px-2.5 py-1.5 rounded-md hover:bg-black/30',
132+
{ 'text-primary font-bold bg-black/10': route === props.href }
132133
)}
133134
>
134135
{children}
@@ -162,11 +163,15 @@ export const Sidebar = ({ ...props }: SidebarProps) => {
162163
<aside
163164
{...props}
164165
className={clsx(
165-
'flex-col-4 w-50 min-w-56 rounded-lg bg-surface text-on-surface overflow-hidden mb-4 p-2.5',
166+
'flex-col-4 w-50 min-w-56 rounded-lg bg-surface text-on-surface overflow-hidden p-2.5',
166167
props.className
167168
)}
168169
>
169170
<nav className="flex-col-2 overflow-auto">
171+
<Link href="/" className="flex-row-2 text-primary items-center rounded-lg p-2 mb-8">
172+
<HelpwaveLogo className="min-h-7 min-w-7 p-0.5 bg-header-background rounded-md"/>
173+
<span className="typography-title-md whitespace-nowrap">{'helpwave tasks'}</span>
174+
</Link>
170175
{/* TODO add station swticher here */}
171176
<SidebarLink href="/" route={route}>
172177
<Grid2X2PlusIcon className="-rotate-90"/>
@@ -203,14 +208,14 @@ export const Page = ({
203208
pageTitle,
204209
}: PageWithHeaderProps) => {
205210
return (
206-
<div className="flex-col-4 h-screen w-screen overflow-hidden pt-4 pl-4">
211+
<div className="flex-row-8 h-screen w-screen overflow-hidden">
207212
<Head>
208213
<title>{titleWrapper(pageTitle)}</title>
209214
</Head>
210215
<StagingDisclaimerDialog/>
211-
<Header className="mr-4"/>
212-
<div className="flex-row-4 grow overflow-hidden">
213-
<Sidebar/>
216+
<Sidebar className="my-4 ml-4"/>
217+
<div className="flex-col-4 grow overflow-hidden">
218+
<Header className="mr-4 mt-4 bg-background text-on-background"/>
214219
<main className="flex-col-2 grow overflow-auto">
215220
{children}
216221
<div className="min-h-16"/>

web/i18n/translations.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ export type TasksTranslationEntries = {
2525
'myTasks': string,
2626
'nBed': (values: { count: number }) => string,
2727
'nOrganization': (values: { count: number }) => string,
28+
'notAssigned': string,
2829
'notes': string,
2930
'nPatient': (values: { count: number }) => string,
3031
'nRoom': (values: { count: number }) => string,
32+
'nTask': (values: { count: number }) => string,
3133
'nWard': (values: { count: number }) => string,
3234
'pages.404.notFound': string,
3335
'pages.404.notFoundDescription1': string,
@@ -70,6 +72,7 @@ export const tasksTranslation: Translation<TasksTranslationLocales, Partial<Task
7072
'other': `${count} Organisationen`,
7173
})
7274
},
75+
'notAssigned': `Nicht zugewiesen`,
7376
'notes': `Notizen`,
7477
'nPatient': ({ count }): string => {
7578
return TranslationGen.resolvePlural(count, {
@@ -83,6 +86,12 @@ export const tasksTranslation: Translation<TasksTranslationLocales, Partial<Task
8386
'other': `${count} Zimmer`,
8487
})
8588
},
89+
'nTask': ({ count }): string => {
90+
return TranslationGen.resolvePlural(count, {
91+
'=1': `${count} Aufgabe`,
92+
'other': `${count} Aufgaben`,
93+
})
94+
},
8695
'nWard': ({ count }): string => {
8796
return TranslationGen.resolvePlural(count, {
8897
'=1': `${count} Station`,
@@ -128,6 +137,7 @@ export const tasksTranslation: Translation<TasksTranslationLocales, Partial<Task
128137
'other': `${count} Organizations`,
129138
})
130139
},
140+
'notAssigned': `Not assigned`,
131141
'notes': `notes`,
132142
'nPatient': ({ count }): string => {
133143
return TranslationGen.resolvePlural(count, {
@@ -141,6 +151,12 @@ export const tasksTranslation: Translation<TasksTranslationLocales, Partial<Task
141151
'other': `${count} Rooms`,
142152
})
143153
},
154+
'nTask': ({ count }): string => {
155+
return TranslationGen.resolvePlural(count, {
156+
'=1': `${count} Task`,
157+
'other': `${count} Tasks`,
158+
})
159+
},
144160
'nWard': ({ count }): string => {
145161
return TranslationGen.resolvePlural(count, {
146162
'=1': `${count} Ward`,

web/locales/de-DE.arb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@
3939
}
4040
}
4141
},
42+
"nTask": "{count, plural, =1{# Aufgabe} other{# Aufgaben}}",
43+
"@nTask": {
44+
"placeholders": {
45+
"count": {
46+
"type": "number"
47+
}
48+
}
49+
},
4250
"visibility": "Sichtbarkeit",
4351
"private": "Privat",
4452
"public": "Öffentlich",
@@ -61,5 +69,6 @@
6169
"rooms": "Zimmer",
6270
"loginRequired": "Login benötigt",
6371
"loginRequiredDescription": "Um diese Seite benutzen zu können musst du eingeloggt sein.",
64-
"login": "Login"
72+
"login": "Login",
73+
"notAssigned": "Nicht zugewiesen"
6574
}

web/locales/en-US.arb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@
3939
}
4040
}
4141
},
42+
"nTask": "{count, plural, =1{# Task} other{# Tasks}}",
43+
"@nTask": {
44+
"placeholders": {
45+
"count": {
46+
"type": "number"
47+
}
48+
}
49+
},
4250
"visibility": "Visibility",
4351
"private": "private",
4452
"public": "public",
@@ -61,5 +69,6 @@
6169
"rooms": "Rooms",
6270
"loginRequired": "Login required",
6371
"loginRequiredDescription": "To use this site you need to be logged in.",
64-
"login": "Login"
72+
"login": "Login",
73+
"notAssigned": "Not assigned"
6574
}

web/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import './build/dev/types/routes.d.ts'
3+
import "./build/dev/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.

0 commit comments

Comments
 (0)