Skip to content

Commit cfeae9c

Browse files
committed
Autofix import issues
1 parent e659649 commit cfeae9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+305
-278
lines changed

src/components/Account/SubmitFeedback.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import React, { useState } from 'react';
2-
import { AppDrawer } from '../ui/drawer';
1+
import { zodResolver } from '@hookform/resolvers/zod';
32
import { ChevronRight, MessageSquare } from 'lucide-react';
4-
import { api } from '~/utils/api';
5-
import { Textarea } from '../ui/textarea';
6-
import { z } from 'zod';
3+
import React, { useState } from 'react';
74
import { useForm } from 'react-hook-form';
8-
import { zodResolver } from '@hookform/resolvers/zod';
9-
import { Form, FormControl, FormField, FormItem, FormMessage } from '../ui/form';
105
import { toast } from 'sonner';
6+
import { z } from 'zod';
7+
8+
import { api } from '~/utils/api';
9+
10+
import { AppDrawer } from '../ui/drawer';
11+
import { Form, FormControl, FormField, FormItem, FormMessage } from '../ui/form';
12+
import { Textarea } from '../ui/textarea';
1113

1214
const feedbackSchema = z.object({
1315
feedback: z

src/components/Account/SubscribeNotification.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { Bell, BellOff, ChevronRight } from 'lucide-react';
12
import React, { useEffect, useState } from 'react';
2-
import { Button } from '../ui/button';
33
import { toast } from 'sonner';
4-
import { env } from '~/env';
5-
import { Bell, BellOff, ChevronRight } from 'lucide-react';
6-
import { api } from '~/utils/api';
4+
75
import { useAppStore } from '~/store/appStore';
6+
import { api } from '~/utils/api';
7+
8+
import { Button } from '../ui/button';
89

910
const base64ToUint8Array = (base64: string) => {
1011
const padding = '='.repeat((4 - (base64.length % 4)) % 4);

src/components/Account/UpdateDetails.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
import { zodResolver } from '@hookform/resolvers/zod';
2+
import { Pencil } from 'lucide-react';
13
import React, { useState } from 'react';
2-
import { AppDrawer } from '../ui/drawer';
3-
import { ChevronRight, MessageSquare, Pencil } from 'lucide-react';
4-
import { api } from '~/utils/api';
5-
import { Textarea } from '../ui/textarea';
6-
import { z } from 'zod';
74
import { useForm } from 'react-hook-form';
8-
import { zodResolver } from '@hookform/resolvers/zod';
5+
import { toast } from 'sonner';
6+
import { z } from 'zod';
7+
8+
import { api } from '~/utils/api';
9+
10+
import { AppDrawer } from '../ui/drawer';
911
import { Form, FormControl, FormField, FormItem, FormMessage } from '../ui/form';
1012
import { Input } from '../ui/input';
11-
import { toast } from 'sonner';
1213

1314
const detailsSchema = z.object({
1415
name: z.string({ required_error: 'Name is required' }).min(1, { message: 'Name is required' }),

src/components/AddExpense/AddExpensePage.tsx

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1+
import { format } from 'date-fns';
2+
import { Banknote, CalendarIcon, Check, HeartHandshakeIcon } from 'lucide-react';
3+
import Link from 'next/link';
14
import { useRouter } from 'next/router';
2-
import React, { useEffect } from 'react';
5+
import React, { useEffect, useState } from 'react';
6+
7+
import { CURRENCIES } from '~/lib/currency';
8+
import { cn } from '~/lib/utils';
39
import { useAddExpenseStore } from '~/store/addStore';
410
import { api } from '~/utils/api';
5-
import { UserInput } from './UserInput';
11+
612
import { SelectUserOrGroup } from './SelectUserOrGroup';
7-
import { AppDrawer, DrawerClose } from '../ui/drawer';
13+
import { SplitTypeSection } from './SplitTypeSection';
14+
import UploadFile from './UploadFile';
15+
import { UserInput } from './UserInput';
816
import { Button } from '../ui/button';
17+
import { Calendar } from '../ui/calendar';
18+
import { CategoryIcons } from '../ui/categoryIcons';
919
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem } from '../ui/command';
10-
import { Banknote, CalendarIcon, Check, HeartHandshakeIcon } from 'lucide-react';
20+
import { AppDrawer, DrawerClose } from '../ui/drawer';
1121
import { Input } from '../ui/input';
12-
import { SplitTypeSection } from './SplitTypeSection';
1322
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';
14-
import { cn } from '~/lib/utils';
15-
import { format } from 'date-fns';
16-
import { Calendar } from '../ui/calendar';
17-
import UploadFile from './UploadFile';
18-
import { CategoryIcons } from '../ui/categoryIcons';
19-
import Link from 'next/link';
20-
import { CURRENCIES } from '~/lib/currency';
21-
import { env } from '~/env';
2223

2324
const categories = {
2425
entertainment: {
@@ -111,7 +112,7 @@ export const AddOrEditExpensePage: React.FC<{
111112
enableSendingInvites: boolean;
112113
expenseId?: string;
113114
}> = ({ isStorageConfigured, enableSendingInvites, expenseId }) => {
114-
const [open, setOpen] = React.useState(false);
115+
const [open, setOpen] = useState(false);
115116

116117
const showFriends = useAddExpenseStore((s) => s.showFriends);
117118
const amount = useAddExpenseStore((s) => s.amount);
@@ -135,7 +136,7 @@ export const AddOrEditExpensePage: React.FC<{
135136
setExpenseDate,
136137
} = useAddExpenseStore((s) => s.actions);
137138

138-
useEffect(() => () => resetState(), []);
139+
useEffect(() => () => resetState(), [resetState]);
139140

140141
const addExpenseMutation = api.user.addOrEditExpense.useMutation();
141142
const addGroupExpenseMutation = api.group.addOrEditExpense.useMutation();
@@ -276,7 +277,7 @@ export const AddOrEditExpensePage: React.FC<{
276277
<div key={categoryName} className="mb-8">
277278
<h3 className="mb-4 text-lg font-semibold">{categoryDetails.name}</h3>
278279
<div className="flex flex-wrap justify-between gap-2">
279-
{categoryDetails.items.map((item, index) =>
280+
{categoryDetails.items.map((item) =>
280281
Object.entries(item).map(([key, value]) => {
281282
const Icon =
282283
CategoryIcons[key] ?? CategoryIcons[categoryName] ?? Banknote;

src/components/AddExpense/SelectUserOrGroup.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import { api } from '~/utils/api';
2-
import { GroupAvatar, UserAvatar } from '../ui/avatar';
3-
import { useAddExpenseStore } from '~/store/addStore';
4-
import { z } from 'zod';
5-
import { Button } from '../ui/button';
6-
import { UserPlusIcon } from '@heroicons/react/24/solid';
71
import { CheckIcon } from '@heroicons/react/24/outline';
2+
import { UserPlusIcon } from '@heroicons/react/24/solid';
83
import { type Group, type GroupUser, type User } from '@prisma/client';
94
import { motion } from 'framer-motion';
10-
import Image from 'next/image';
115
import { SendIcon } from 'lucide-react';
12-
import { env } from '~/env';
6+
import Image from 'next/image';
137
import React from 'react';
8+
import { z } from 'zod';
9+
10+
import { useAddExpenseStore } from '~/store/addStore';
11+
import { api } from '~/utils/api';
12+
13+
import { GroupAvatar, UserAvatar } from '../ui/avatar';
14+
import { Button } from '../ui/button';
1415

1516
export const SelectUserOrGroup: React.FC<{
1617
enableSendingInvites: boolean;

src/components/AddExpense/SplitTypeSection.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import { SplitType } from '@prisma/client';
2+
import { BarChart2, Check, DollarSign, Equal, Percent, Plus, X } from 'lucide-react';
3+
import { useState } from 'react';
4+
15
import { type Participant, useAddExpenseStore } from '~/store/addStore';
2-
import { AppDrawer, Drawer, DrawerClose } from '../ui/drawer';
6+
37
import { UserAvatar } from '../ui/avatar';
4-
import { BarChart2, Check, DollarSign, Equal, Percent, Plus, X } from 'lucide-react';
5-
import { Tabs, TabsContent, TabsList, TabsTrigger } from '../ui/tabs';
8+
import { AppDrawer, DrawerClose } from '../ui/drawer';
69
import { Input } from '../ui/input';
7-
import { useState } from 'react';
8-
import { SplitType } from '@prisma/client';
10+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '../ui/tabs';
911

1012
export const SplitTypeSection: React.FC = () => {
1113
const paidBy = useAddExpenseStore((s) => s.paidBy);

src/components/AddExpense/UploadFile.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import { ImagePlus, Image as ImageUploaded } from 'lucide-react';
12
import React, { useState } from 'react';
2-
import { Input } from '../ui/input';
3-
import { Label } from '../ui/label';
4-
import { type File, FileUp, ImagePlus, Image as ImageUploaded } from 'lucide-react';
3+
import { toast } from 'sonner';
4+
5+
import { FILE_SIZE_LIMIT } from '~/lib/constants';
56
import { useAddExpenseStore } from '~/store/addStore';
67
import { api } from '~/utils/api';
7-
import { FILE_SIZE_LIMIT } from '~/lib/constants';
8-
import { toast } from 'sonner';
8+
9+
import { Input } from '../ui/input';
10+
import { Label } from '../ui/label';
911

1012
const getImgHeightAndWidth = (file: File) => {
1113
return new Promise<{ width: number; height: number }>((resolve, reject) => {

src/components/AddExpense/UserInput.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import { useAddExpenseStore } from '~/store/addStore';
2-
import { GroupAvatar, UserAvatar } from '../ui/avatar';
1+
import Router from 'next/router';
32
import { z } from 'zod';
3+
4+
import { useAddExpenseStore } from '~/store/addStore';
45
import { api } from '~/utils/api';
5-
import Router from 'next/router';
6+
7+
import { GroupAvatar, UserAvatar } from '../ui/avatar';
68

79
export const UserInput: React.FC<{
810
isEditing?: boolean;

src/components/Expense/DeleteExpense.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import React from 'react';
2-
import { Button } from '../ui/button';
31
import { Trash2 } from 'lucide-react';
4-
import { api } from '~/utils/api';
52
import { useRouter } from 'next/router';
3+
import React from 'react';
4+
5+
import { api } from '~/utils/api';
6+
67
import {
78
AlertDialog,
89
AlertDialogAction,
@@ -14,6 +15,7 @@ import {
1415
AlertDialogTitle,
1516
AlertDialogTrigger,
1617
} from '../ui/alert-dialog';
18+
import { Button } from '../ui/button';
1719

1820
export const DeleteExpense: React.FC<{
1921
expenseId: string;

src/components/Expense/ExpensePage.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import { type ExpenseParticipant, type Expense, type User } from '@prisma/client';
2-
import { type User as NextUser } from 'next-auth';
1+
import { type Expense, type ExpenseParticipant, type User } from '@prisma/client';
32
import { format, isSameDay } from 'date-fns';
3+
import { Banknote } from 'lucide-react';
4+
import Image from 'next/image';
5+
import { type User as NextUser } from 'next-auth';
46
import React from 'react';
7+
58
import { toUIString } from '~/utils/numbers';
9+
610
import { UserAvatar } from '../ui/avatar';
7-
import Image from 'next/image';
8-
import { AppDrawer, Drawer, DrawerContent, DrawerTrigger } from '../ui/drawer';
9-
import { Separator } from '../ui/separator';
1011
import { CategoryIcons } from '../ui/categoryIcons';
11-
import { Banknote } from 'lucide-react';
12-
import { env } from '~/env';
12+
import { AppDrawer } from '../ui/drawer';
13+
import { Separator } from '../ui/separator';
1314

1415
type ExpenseDetailsProps = {
1516
user: NextUser;

0 commit comments

Comments
 (0)