Skip to content

Commit

Permalink
fmt --unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
toririm committed Sep 19, 2024
1 parent 28f8c1e commit 873da53
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 29 deletions.
8 changes: 4 additions & 4 deletions app/components/ui/alert-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const AlertDialogOverlay = React.forwardRef<
>(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Overlay
className={cn(
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80 data-[state=closed]:animate-out data-[state=open]:animate-in",
className,
)}
{...props}
Expand All @@ -34,7 +34,7 @@ const AlertDialogContent = React.forwardRef<
<AlertDialogPrimitive.Content
ref={ref}
className={cn(
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:rounded-lg",
className,
)}
{...props}
Expand Down Expand Up @@ -77,7 +77,7 @@ const AlertDialogTitle = React.forwardRef<
>(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Title
ref={ref}
className={cn("text-lg font-semibold", className)}
className={cn("font-semibold text-lg", className)}
{...props}
/>
));
Expand All @@ -89,7 +89,7 @@ const AlertDialogDescription = React.forwardRef<
>(({ className, ...props }, ref) => (
<AlertDialogPrimitive.Description
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
className={cn("text-muted-foreground text-sm", className)}
{...props}
/>
));
Expand Down
4 changes: 2 additions & 2 deletions app/components/ui/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const CardTitle = React.forwardRef<
<h3
ref={ref}
className={cn(
"text-2xl font-semibold leading-none tracking-tight",
"font-semibold text-2xl leading-none tracking-tight",
className,
)}
{...props}
Expand All @@ -50,7 +50,7 @@ const CardDescription = React.forwardRef<
>(({ className, ...props }, ref) => (
<p
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
className={cn("text-muted-foreground text-sm", className)}
{...props}
/>
));
Expand Down
2 changes: 1 addition & 1 deletion app/components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
<input
type={type}
className={cn(
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className,
)}
ref={ref}
Expand Down
2 changes: 1 addition & 1 deletion app/components/ui/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const TableCaption = React.forwardRef<
>(({ className, ...props }, ref) => (
<caption
ref={ref}
className={cn("mt-4 text-sm text-muted-foreground", className)}
className={cn("mt-4 text-muted-foreground text-sm", className)}
{...props}
/>
));
Expand Down
6 changes: 2 additions & 4 deletions app/repositories/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ export const itemRepoFactory = (db: Firestore): ItemRepository => {
save: async (item) => {
if (hasId(item)) {
return await update(item);
} else {
return await create(item);
}
return await create(item);
},

delete: async (id) => {
Expand All @@ -55,9 +54,8 @@ export const itemRepoFactory = (db: Firestore): ItemRepository => {
const docSnap = await getDoc(docRef);
if (docSnap.exists()) {
return docSnap.data();
} else {
return null;
}
return null;
},

findAll: async () => {
Expand Down
3 changes: 1 addition & 2 deletions app/repositories/order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ export const orderRepoFactory = (db: Firestore): OrderRepository => {
save: async (order) => {
if (hasId(order)) {
return await update(order);
} else {
return await create(order);
}
return await create(order);
},

delete: async (id) => {
Expand Down
2 changes: 1 addition & 1 deletion app/routes/_header.casher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function Casher() {
<div className="w-1/3">
<div>
<Table>
<TableCaption></TableCaption>
<TableCaption />
<TableHeader>
<TableRow>
<TableHead className="w-500">
Expand Down
28 changes: 14 additions & 14 deletions app/routes/items/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ export default function Item() {
}, [items]);

return (
<div className="font-sans p-4 bg-white">
<h1 className="text-3xl font-bold text-gray-800 mb-6">アイテム管理</h1>
<div className="bg-white p-4 font-sans">
<h1 className="mb-6 font-bold text-3xl text-gray-800">アイテム管理</h1>

<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="grid grid-cols-1 gap-6 md:grid-cols-2">
<div>
<h2 className="text-2xl font-semibold text-gray-700 mb-4">
<h2 className="mb-4 font-semibold text-2xl text-gray-700">
新規アイテム登録
</h2>
<Form
method="POST"
id={form.id}
onSubmit={form.onSubmit}
className="space-y-4 bg-white p-6 rounded-lg shadow-md border border-gray-200"
className="space-y-4 rounded-lg border border-gray-200 bg-white p-6 shadow-md"
>
<div>
<Label htmlFor={fields.name.id} className="text-gray-700">
Expand All @@ -80,7 +80,7 @@ export default function Item() {
defaultValue={fields.name.initialValue}
required
placeholder="アイテム名"
className="w-full mt-1"
className="mt-1 w-full"
/>
{fields.name.errors && (
<span className="text-red-500 text-sm">
Expand All @@ -100,7 +100,7 @@ export default function Item() {
defaultValue={fields.price.initialValue}
required
placeholder="価格"
className="w-full mt-1"
className="mt-1 w-full"
/>
{fields.price.errors && (
<span className="text-red-500 text-sm">
Expand Down Expand Up @@ -131,30 +131,30 @@ export default function Item() {
</div>
<Button
type="submit"
className="w-full bg-purple-600 hover:bg-purple-700 text-white"
className="w-full bg-purple-600 text-white hover:bg-purple-700"
>
登録
</Button>
</Form>
</div>

<div>
<h2 className="text-2xl font-semibold text-gray-700 mb-4">
<h2 className="mb-4 font-semibold text-2xl text-gray-700">
登録済みアイテム
</h2>
{itemtypes.map((type) => (
<div key={type} className="mb-6">
<h3 className="text-xl font-semibold text-purple-700 mb-2">
<h3 className="mb-2 font-semibold text-purple-700 text-xl">
{type2label[type]}
</h3>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
{sortedItems[type]?.map((item) => (
<div
key={item.id}
className="bg-white shadow-sm hover:shadow-md transition-shadow rounded-lg overflow-hidden border border-gray-200"
className="overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm transition-shadow hover:shadow-md"
>
<div className="bg-purple-100 p-4">
<h4 className="text-lg font-medium text-purple-800">
<h4 className="font-medium text-lg text-purple-800">
{item.name}
</h4>
</div>
Expand All @@ -166,7 +166,7 @@ export default function Item() {
<input type="hidden" name="itemId" value={item.id} />
<Button
type="submit"
className="w-full bg-red-500 hover:bg-red-600 text-white"
className="w-full bg-red-500 text-white hover:bg-red-600"
>
削除
</Button>
Expand Down

0 comments on commit 873da53

Please sign in to comment.