Skip to content

Commit

Permalink
fix(gluwave): Table padding #178
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalhama committed Oct 10, 2024
1 parent 8640168 commit e6a90a3
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 43 deletions.
80 changes: 39 additions & 41 deletions gluwave/src/app/(app-menu)/glucose/list/glucose-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,50 +54,48 @@ export const GlucoseList = ({ start, end }: Props) => {
}

return (
<>
<div className="p-2">
<div className="space-y-4 border bg-white max-w-5xl mx-auto rounded-md shadow p-2 mt-4">
<div>
<Table>
<TableHeader>
<Table>
<TableHeader>
<TableRow>
<TableHead>Timestamp</TableHead>
<TableHead>Amount</TableHead>
<TableHead className="text-right"></TableHead>
</TableRow>
</TableHeader>
<TableBody>
{g.data.map((g) => (
<TableRow key={g.id}>
<TableCell className="font-medium">
<ClientDateTime timestamp={g.timestamp} />
</TableCell>
<TableCell>{g.value} mmol/l</TableCell>
<TableCell className="text-right flex justify-end">
<GlucoseDialog
glucose={{
...g,
glucose: g.value,
}}
>
<Button variant="ghost" className="p-2">
<Pencil className="cursor-pointer w-4 h-4" />
</Button>
</GlucoseDialog>
<GlucoseDeleteDialog id={g.id} />
</TableCell>
</TableRow>
))}
{g.data.length === 0 && (
<TableRow>
<TableHead>Timestamp</TableHead>
<TableHead>Amount</TableHead>
<TableHead className="text-right"></TableHead>
<TableCell colSpan={3} className="text-slate-400">
No entries
</TableCell>
</TableRow>
</TableHeader>
<TableBody>
{g.data.map((g) => (
<TableRow key={g.id}>
<TableCell className="font-medium">
<ClientDateTime timestamp={g.timestamp} />
</TableCell>
<TableCell>{g.value} mmol/l</TableCell>
<TableCell className="text-right flex justify-end">
<GlucoseDialog
glucose={{
...g,
glucose: g.value,
}}
>
<Button variant="ghost" className="p-2">
<Pencil className="cursor-pointer w-4 h-4" />
</Button>
</GlucoseDialog>
<GlucoseDeleteDialog id={g.id} />
</TableCell>
</TableRow>
))}
{g.data.length === 0 && (
<TableRow>
<TableCell colSpan={3} className="text-slate-400">
No entries
</TableCell>
</TableRow>
)}
</TableBody>
</Table>
</div>
)}
</TableBody>
</Table>
</div>
</>
</div>
)
}
4 changes: 2 additions & 2 deletions gluwave/src/app/(app-menu)/insulin/list/insulin-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export function InsulinList({ start, end }: Props) {
}

return (
<div className="space-y-4 border bg-white max-w-5xl mx-auto rounded-md shadow p-2 mt-4">
<div>
<div className="p-2">
<div className="space-y-4 border bg-white max-w-5xl mx-auto rounded-md shadow p-2 mt-4">
<Table>
<TableHeader>
<TableRow>
Expand Down

0 comments on commit e6a90a3

Please sign in to comment.