Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/cashier-mini itemを表示する #413

Merged
merged 4 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bun.lockb
Binary file not shown.
83 changes: 67 additions & 16 deletions pos/app/routes/cashier-mini.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export default function CasherMini() {
);
const order = orderState?.edittingOrder;
const submittedOrderId = orderState?.submittedOrderId;

const { data: preOrder } = useSWRSubscription(
["orders", submittedOrderId ?? "none"],
documentSub({ converter: orderConverter }),
Expand Down Expand Up @@ -117,23 +116,75 @@ export default function CasherMini() {
>
<button type="button" className="absolute top-0 left-0 h-24 w-60" />
<img src={logoSVG} alt="" className="absolute h-screen w-screen p-28" />
<div className="wrap flex flex-col px-[50px] pt-[40px]">
<p className="pb-[50px] font-serif text-5xl text-white">
No. <span className="text-6xl">{orderId}</span>
<div className="flex h-screen w-screen flex-col px-28 py-10 font-noto">
<p className="flex-none pb-16 font-medium text-5xl text-white">
No. <span className="font-semibold text-7xl">{orderId}</span>
</p>
<div className="grid grid-cols-2 items-center justify-items-center p-[20px]">
<div>
<p className="font-serif text-4xl text-white">
商品点数: {order?.items.length ?? 0} 点
</p>
<div className="flex h-4/5 flex-col justify-between">
<div className="">
{order?.items.map((item, idx) => {
return (
<div
key={`${idx}-${item.id}`}
className="flex items-center justify-between pb-7"
>
<p className="flex-none pr-14 font-bold text-6xl text-white">
{idx + 1}
</p>
<p className="flex-1 font-bold text-5xl text-white">
{item.name}
</p>
<p className="flex-none font-bold text-5xl text-white">
{item.price} 円
</p>
</div>
);
})}
<div className="flex items-center justify-between pb-7">
{(order?.discount ?? 0) > 0 && (
<>
<p className="flex-none pr-14 font-bold text-3xl text-white">
割引
</p>
<p className="font-bold text-4xl text-white">
-{order?.discount} 円
</p>
</>
)}
</div>
</div>
<div>
<p className="font-serif text-4xl text-white">
合計: {order?.billingAmount ?? 0} 円
</p>
<p className="font-serif text-4xl text-white">
お釣り: {Math.max(charge, 0)} 円
</p>
<div className="">
<div className="mb-7 h-1 w-full bg-white" />
<div className="flex items-center justify-between pb-7">
<p className="flex-none pr-14 font-bold text-5xl text-white">
合計
</p>
<p className="font-bold text-5xl text-white">
{order?.billingAmount} 円
</p>
</div>
<div className="flex h-14 items-center justify-between pb-7">
{(order?.received ?? 0) > 0 && (
<>
<p className="flex-none pr-14 font-bold text-4xl text-white">
お預かり
</p>
<p className="font-bold text-4xl text-white">
{order?.received} 円
</p>
</>
)}
</div>
<div className="flex h-12 items-center justify-between pb-7">
{charge >= 0 && (
<>
<p className="flex-none pr-14 font-bold text-4xl text-white">
おつり
</p>
<p className="font-bold text-4xl text-white">{charge} 円</p>
</>
)}
</div>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions pos/app/tailwind.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "@fontsource/zen-old-mincho";
@import "@fontsource-variable/noto-sans-jp";

@tailwind base;
@tailwind components;
Expand Down
1 change: 1 addition & 0 deletions pos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"@conform-to/react": "^1.2.2",
"@conform-to/zod": "^1.2.2",
"@fontsource-variable/noto-sans-jp": "^5.1.0",
"@fontsource/zen-old-mincho": "^5.1.0",
"@radix-ui/react-alert-dialog": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.2",
Expand Down
1 change: 1 addition & 0 deletions pos/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ module.exports = {
},
fontFamily: {
zen: "Zen Old Mincho",
noto: "Noto Sans JP Variable",
},
keyframes: {
"accordion-down": {
Expand Down