Skip to content

Commit af79843

Browse files
committed
pnpm run check
1 parent 629f746 commit af79843

Some content is hidden

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

69 files changed

+885
-1443
lines changed

app/api.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import {
2-
createStartAPIHandler,
3-
defaultAPIFileRouteHandler,
4-
} from "@tanstack/start/api";
1+
import { createStartAPIHandler, defaultAPIFileRouteHandler } from "@tanstack/start/api";
52

63
export default createStartAPIHandler(defaultAPIFileRouteHandler);

app/client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { StartClient } from "@tanstack/start";
12
/// <reference types="vinxi/types/client" />
23
import { hydrateRoot } from "react-dom/client";
3-
import { StartClient } from "@tanstack/start";
44
import { createRouter } from "./router";
55

66
const router = createRouter();

app/components/account-tier-text.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function AccountTierText({
1616
<span
1717
className={cn(
1818
"bg-gradient-to-r from-orange-400 to-red-400 bg-clip-text text-transparent font-bold",
19-
className
19+
className,
2020
)}
2121
>
2222
{children}
@@ -29,15 +29,13 @@ export function AccountTierText({
2929
<span
3030
className={cn(
3131
"bg-gradient-to-r from-pink-500 to-purple-300 bg-clip-text text-transparent font-bold",
32-
className
32+
className,
3333
)}
3434
>
3535
{children}
3636
</span>
3737
);
3838
}
3939

40-
return (
41-
<span className={cn(defaultColor, "font-bold", className)}>{children}</span>
42-
);
40+
return <span className={cn(defaultColor, "font-bold", className)}>{children}</span>;
4341
}

app/components/author-info.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AccountTierText } from "@/components/account-tier-text";
2-
import { useQuery } from "@tanstack/react-query";
32
import { authorDataQueryOptions } from "@/lib/query-utils";
3+
import { useQuery } from "@tanstack/react-query";
44

55
export function AuthorInfo({ authorId }: { authorId: string }) {
66
const { data } = useQuery(authorDataQueryOptions(authorId));

app/components/blur-fade-text.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { useRef } from "react";
21
import {
32
AnimatePresence,
4-
motion,
5-
useInView,
63
type UseInViewOptions,
74
type Variants,
5+
motion,
6+
useInView,
87
} from "framer-motion";
8+
import { useRef } from "react";
99

1010
type MarginType = UseInViewOptions["margin"];
1111

app/components/dialogs/delete-video-dialog.tsx

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,26 @@
11
import { Button } from "@/components/ui/button";
2-
import { toast } from "sonner";
32
import { usageDataQueryOptions, videosQueryOptions } from "@/lib/query-utils";
3+
import { useDialogsStore } from "@/lib/stores/dialogs";
44
import { notNanOrDefault } from "@/lib/utils";
55
import { deleteVideoServerFn } from "@/server-fns/videos";
6-
import { useDialogsStore } from "@/lib/stores/dialogs";
76
import { useQueryClient } from "@tanstack/react-query";
8-
import {
9-
Dialog,
10-
DialogContent,
11-
DialogHeader,
12-
DialogTitle,
13-
DialogDescription,
14-
} from "../ui/dialog";
7+
import { toast } from "sonner";
8+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../ui/dialog";
159

1610
export function DeleteVideoDialog() {
1711
const queryClient = useQueryClient();
1812

19-
const closeDeleteVideoDialog = useDialogsStore(
20-
(state) => state.closeDeleteVideoDialog
21-
);
22-
const deleteVideoDialogData = useDialogsStore(
23-
(state) => state.deleteVideoDialogData
24-
);
25-
const isDeleteVideoDialogOpen = useDialogsStore(
26-
(state) => state.isDeleteVideoDialogOpen
27-
);
13+
const closeDeleteVideoDialog = useDialogsStore((state) => state.closeDeleteVideoDialog);
14+
const deleteVideoDialogData = useDialogsStore((state) => state.deleteVideoDialogData);
15+
const isDeleteVideoDialogOpen = useDialogsStore((state) => state.isDeleteVideoDialogOpen);
2816

2917
async function doDeleteVideo() {
3018
if (!isDeleteVideoDialogOpen || !deleteVideoDialogData) {
3119
return;
3220
}
3321

3422
const oldVideos = queryClient.getQueryData(videosQueryOptions.queryKey);
35-
const oldUsageData = queryClient.getQueryData(
36-
usageDataQueryOptions.queryKey
37-
);
23+
const oldUsageData = queryClient.getQueryData(usageDataQueryOptions.queryKey);
3824

3925
function reset(message?: string) {
4026
queryClient.setQueryData(usageDataQueryOptions.queryKey, oldUsageData);
@@ -50,8 +36,7 @@ export function DeleteVideoDialog() {
5036
}
5137

5238
try {
53-
const videos =
54-
queryClient.getQueryData(videosQueryOptions.queryKey)?.videos ?? [];
39+
const videos = queryClient.getQueryData(videosQueryOptions.queryKey)?.videos ?? [];
5540

5641
const video = videos.find((v) => v.id === deleteVideoDialogData.videoId);
5742

@@ -63,9 +48,8 @@ export function DeleteVideoDialog() {
6348
return {
6449
...old,
6550
totalStorageUsed: Math.max(
66-
(old?.totalStorageUsed ?? 0) -
67-
notNanOrDefault(video?.fileSizeBytes),
68-
0
51+
(old?.totalStorageUsed ?? 0) - notNanOrDefault(video?.fileSizeBytes),
52+
0,
6953
),
7054
};
7155
});
@@ -77,9 +61,7 @@ export function DeleteVideoDialog() {
7761

7862
return {
7963
...old,
80-
videos: old.videos.filter(
81-
(v) => v.id !== deleteVideoDialogData.videoId
82-
),
64+
videos: old.videos.filter((v) => v.id !== deleteVideoDialogData.videoId),
8365
};
8466
});
8567

@@ -93,7 +75,7 @@ export function DeleteVideoDialog() {
9375
loading: "Queueing video for deletion...",
9476
error: "Error deleting video",
9577
success: (result) => result.message,
96-
}
78+
},
9779
);
9880
} catch (e) {
9981
console.error(e);
@@ -118,8 +100,7 @@ export function DeleteVideoDialog() {
118100
<DialogHeader>
119101
<DialogTitle>Confirm Video Deletion</DialogTitle>
120102
<DialogDescription>
121-
Are you sure you want to delete{" "}
122-
<strong>{deleteVideoDialogData.videoTitle}</strong>?
103+
Are you sure you want to delete <strong>{deleteVideoDialogData.videoTitle}</strong>?
123104
</DialogDescription>
124105
</DialogHeader>
125106
<div className="flex gap-2 items-end">

app/components/dialogs/edit-video-dialog.tsx

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import { Button } from "@/components/ui/button";
22
import { Input } from "@/components/ui/input";
33
import { Label } from "@/components/ui/label";
44
import { Switch } from "@/components/ui/switch";
5+
import { videosQueryOptions } from "@/lib/query-utils";
6+
import { useDialogsStore } from "@/lib/stores/dialogs";
7+
import { updateVideoDataServerFn } from "@/server-fns/videos";
58
import { useForm } from "@tanstack/react-form";
9+
import { useQuery, useQueryClient } from "@tanstack/react-query";
10+
import { useRouter } from "@tanstack/react-router";
611
import { useEffect } from "react";
712
import { toast } from "sonner";
8-
import { FieldInfo } from "./upload-video-dialog";
9-
import { useRouter } from "@tanstack/react-router";
10-
import { updateVideoDataServerFn } from "@/server-fns/videos";
11-
import { useQuery, useQueryClient } from "@tanstack/react-query";
12-
import { videosQueryOptions } from "@/lib/query-utils";
13-
import { useDialogsStore } from "@/lib/stores/dialogs";
1413
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../ui/dialog";
14+
import { FieldInfo } from "./upload-video-dialog";
1515

1616
type FormData = {
1717
title?: string;
@@ -23,19 +23,11 @@ export function EditVideoDialog() {
2323
const queryClient = useQueryClient();
2424
const { data } = useQuery(videosQueryOptions);
2525

26-
const editVideoDialogData = useDialogsStore(
27-
(state) => state.editVideoDialogData
28-
);
29-
const isEditVideoDialogOpen = useDialogsStore(
30-
(state) => state.isEditVideoDialogOpen
31-
);
32-
const closeEditVideoDialog = useDialogsStore(
33-
(state) => state.closeEditVideoDialog
34-
);
26+
const editVideoDialogData = useDialogsStore((state) => state.editVideoDialogData);
27+
const isEditVideoDialogOpen = useDialogsStore((state) => state.isEditVideoDialogOpen);
28+
const closeEditVideoDialog = useDialogsStore((state) => state.closeEditVideoDialog);
3529

36-
const videoData = data?.videos.find(
37-
(v) => v.id === editVideoDialogData?.videoId
38-
);
30+
const videoData = data?.videos.find((v) => v.id === editVideoDialogData?.videoId);
3931

4032
async function handleUpdateVideo(data: FormData) {
4133
try {
@@ -134,8 +126,7 @@ export function EditVideoDialog() {
134126
validators={{
135127
onChange: ({ value }) => {
136128
if (!value) return "A video title is required";
137-
if (value.length > 100)
138-
return "Title must be 100 characters or less";
129+
if (value.length > 100) return "Title must be 100 characters or less";
139130
return undefined;
140131
},
141132
}}
@@ -177,11 +168,7 @@ export function EditVideoDialog() {
177168
}}
178169
/>
179170
<div className="flex gap-2 mt-2">
180-
<Button
181-
variant="outline"
182-
className="grow basis-1/2"
183-
onClick={closeEditVideoDialog}
184-
>
171+
<Button variant="outline" className="grow basis-1/2" onClick={closeEditVideoDialog}>
185172
Cancel
186173
</Button>
187174
<Button className="grow basis-1/2" type="submit">

0 commit comments

Comments
 (0)