Skip to content

Commit

Permalink
Bump
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemans committed Dec 18, 2024
1 parent 9a1afe1 commit f7ee60d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 11 deletions.
42 changes: 42 additions & 0 deletions web/src/components/print/PrintModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { FC } from 'react';
import { FiPrinter } from 'react-icons/fi';

import { Button } from '../ui/Button';
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from '../ui/Dialog';

export const PrintLabelModal: FC<{ label_id: string }> = ({ label_id }) => {
return (
<DialogContent>
<DialogHeader>
<DialogTitle>Print Label</DialogTitle>
</DialogHeader>
<DialogDescription>
Print the label for the given label id.
</DialogDescription>
<DialogFooter>
<Button>Print</Button>
</DialogFooter>
</DialogContent>
);
};

export const PrintLabelButton: FC<{ label_id: string }> = ({ label_id }) => {
return (
<Dialog>
<DialogTrigger>
<Button size="icon">
<FiPrinter />
</Button>
</DialogTrigger>
<PrintLabelModal label_id={label_id} />
</Dialog>
);
};
3 changes: 1 addition & 2 deletions web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@
@apply text-base font-semibold px-2 py-1.5;
}

/* reset */
a {
all: unset;
padding: 0;
}

.pre {
Expand Down
22 changes: 13 additions & 9 deletions web/src/routes/item/$itemId/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { getPolicy } from '@/api/policy';
import { ItemFields } from '@/components/item/ItemFields';
import { ItemLogSection } from '@/components/logs/ItemLogSection';
import { MediaGallery } from '@/components/media/MediaGallery';
import { PrintLabelButton } from '@/components/print/PrintModal';
import { Tag } from '@/components/Tag';
import { Button } from '@/components/ui/Button';
import { UserProfile } from '@/components/UserProfile';
Expand Down Expand Up @@ -72,15 +73,18 @@ export const Route = createFileRoute('/item/$itemId/')({
<SCPage
title={(item.data && item.data.name) || `Item ${itemId}`}
suffix={
<Button asChild>
<Link
to="/item/$itemId/edit"
params={{ itemId }}
aria-label="Edit"
>
<FiEdit />
</Link>
</Button>
<div className="flex gap-2">
<PrintLabelButton label_id={itemId} />
<Button asChild>
<Link
to="/item/$itemId/edit"
params={{ itemId }}
aria-label="Edit"
>
<FiEdit />
</Link>
</Button>
</div>
}
>
<div className="card pt-4">
Expand Down

0 comments on commit f7ee60d

Please sign in to comment.