Skip to content

Commit fc3db43

Browse files
committed
style: Apply code formatting with format:fix
1 parent e707132 commit fc3db43

9 files changed

Lines changed: 244 additions & 195 deletions

File tree

index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
<link rel="apple-touch-icon" href="/favicon-180.png" />
2323
<link rel="manifest" href="/manifest.webmanifest" />
2424
<link rel="preconnect" href="https://api.github.com" crossorigin />
25-
<link rel="preconnect" href="https://raw.githubusercontent.com" crossorigin />
25+
<link
26+
rel="preconnect"
27+
href="https://raw.githubusercontent.com"
28+
crossorigin />
2629
<link rel="preconnect" href="https://github.com" crossorigin />
2730
<meta
2831
http-equiv="Content-Security-Policy"

src/api/github/workers/imageFileTreeWorker.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ImageFileTreeWorker extends BaseGithubWorker<
5151
file =>
5252
!zipData.files[file].dir && // Not a directory
5353
(imageExtensions.some(ext => file.toLowerCase().endsWith(ext)) || // Image file
54-
file.toLowerCase().endsWith('.mcmeta')), // Or mcmeta file
54+
file.toLowerCase().endsWith('.mcmeta')), // Or mcmeta file
5555
)
5656
.map(file => file.replace(`${rootFolder}/`, '')) // Remove root folder
5757
}
@@ -104,7 +104,11 @@ class ImageFileTreeWorker extends BaseGithubWorker<
104104
response: ImageFileTreeResponse,
105105
): GithubImageFileTree {
106106
return response.tree.reduce((acc, {path, type}) => {
107-
if (type === 'blob' && (IMAGE_FILE_EXTENSIONS_REGEX.test(path) || MCMETA_FILE_EXTENSIONS_REGEX.test(path))) {
107+
if (
108+
type === 'blob' &&
109+
(IMAGE_FILE_EXTENSIONS_REGEX.test(path) ||
110+
MCMETA_FILE_EXTENSIONS_REGEX.test(path))
111+
) {
108112
acc.push(path)
109113
}
110114
return acc

src/components/FilterInput.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ export function FilterInput({
4242

4343
return (
4444
<div
45-
className={cn(
46-
'flex w-full items-center justify-end gap-1.5',
47-
className,
48-
)}
45+
className={cn('flex w-full items-center justify-end gap-1.5', className)}
4946
{...props}>
5047
<div className="relative flex-1 max-w-lg">
5148
<Input
@@ -59,7 +56,8 @@ export function FilterInput({
5956
aria-describedby="filter-description"
6057
/>
6158
<span id="filter-description" className="sr-only">
62-
Enter keywords to include or exclude images. Use '-keyword' to exclude.
59+
Enter keywords to include or exclude images. Use '-keyword' to
60+
exclude.
6361
</span>
6462
<Button
6563
aria-label="Clear filter"

src/components/ImageCell.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,19 @@ const ImageCell = memo(function ImageCell({
3333
setLoading(false)
3434
}, [])
3535

36-
const handleImageRef = useCallback((img: HTMLImageElement | null) => {
37-
imgRef.current = img
38-
if (currentPathRef.current !== path) {
39-
currentPathRef.current = path
40-
setLoading(true)
41-
}
42-
if (img && img.complete) {
43-
setLoading(false)
44-
}
45-
}, [path])
36+
const handleImageRef = useCallback(
37+
(img: HTMLImageElement | null) => {
38+
imgRef.current = img
39+
if (currentPathRef.current !== path) {
40+
currentPathRef.current = path
41+
setLoading(true)
42+
}
43+
if (img && img.complete) {
44+
setLoading(false)
45+
}
46+
},
47+
[path],
48+
)
4649

4750
const handleKeyDown = useCallback(
4851
(e: React.KeyboardEvent<HTMLDivElement>) => {
@@ -78,7 +81,10 @@ const ImageCell = memo(function ImageCell({
7881
className="size-full flex justify-center items-center opacity-5 ring-muted-foreground ring-1 rounded-md"
7982
style={{display: loading ? 'block' : 'none'}}
8083
aria-hidden="true">
81-
<LoaderCircleIcon className="size-full object-contain text-muted animate-spin duration-[3s]" aria-hidden="true" />
84+
<LoaderCircleIcon
85+
className="size-full object-contain text-muted animate-spin duration-[3s]"
86+
aria-hidden="true"
87+
/>
8288
</div>
8389
<img
8490
ref={handleImageRef}

0 commit comments

Comments
 (0)