Apply the auto-fixable lint rules and the formatter, and drop the Vite build artifacts.
This commit is contained in:
@@ -57,7 +57,7 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||
Array.from(savedImages).find(([, img]) => img.shortcode === shortcode) !== undefined;
|
||||
return hasInSaved;
|
||||
},
|
||||
[imagePack, savedImages, uploadedImages]
|
||||
[imagePack, savedImages, uploadedImages],
|
||||
);
|
||||
|
||||
const pickFiles = useFilePicker(
|
||||
@@ -74,9 +74,9 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||
|
||||
setFiles((f) => [...f, ...uniqueFiles]);
|
||||
},
|
||||
[hasImageWithShortcode]
|
||||
[hasImageWithShortcode],
|
||||
),
|
||||
true
|
||||
true,
|
||||
);
|
||||
|
||||
const handleMetaSave = useCallback(
|
||||
@@ -88,10 +88,10 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||
...imagePack.meta.content,
|
||||
...m?.content,
|
||||
...editedMeta.content,
|
||||
})
|
||||
}),
|
||||
);
|
||||
},
|
||||
[imagePack.meta]
|
||||
[imagePack.meta],
|
||||
);
|
||||
|
||||
const handleMetaCancel = () => setMetaEditing(false);
|
||||
@@ -104,10 +104,10 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||
...imagePack.meta.content,
|
||||
...m?.content,
|
||||
usage: usg,
|
||||
})
|
||||
}),
|
||||
);
|
||||
},
|
||||
[imagePack.meta]
|
||||
[imagePack.meta],
|
||||
);
|
||||
|
||||
const handleUploadRemove = useCallback((file: TUploadContent) => {
|
||||
@@ -123,13 +123,13 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||
};
|
||||
const image = PackImageReader.fromPackImage(
|
||||
getFileNameWithoutExt(data.file.name),
|
||||
packImage
|
||||
packImage,
|
||||
);
|
||||
if (!image) return;
|
||||
handleUploadRemove(data.file);
|
||||
setUploadedImages((imgs) => [image, ...imgs]);
|
||||
},
|
||||
[handleUploadRemove]
|
||||
[handleUploadRemove],
|
||||
);
|
||||
|
||||
const handleImageEdit = (shortcode: string) => {
|
||||
@@ -164,7 +164,7 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||
? new PackImageReader(
|
||||
suffixRename(image.shortcode, hasImageWithShortcode),
|
||||
image.url,
|
||||
image.content
|
||||
image.content,
|
||||
)
|
||||
: image;
|
||||
|
||||
@@ -199,7 +199,7 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||
images.forEach((img) => pushImage(img));
|
||||
|
||||
return onUpdate?.(pack);
|
||||
}, [imagePack, images, savedMeta, uploadedImages, savedImages, deleteImages, onUpdate])
|
||||
}, [imagePack, images, savedMeta, uploadedImages, savedImages, deleteImages, onUpdate]),
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -384,5 +384,5 @@ export const ImagePackContent = as<'div', ImagePackContentProps>(
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { FormEventHandler, useCallback, useMemo, useState } from 'react';
|
||||
import { Box, Text, Avatar, AvatarFallback, Button, Input, TextArea, Chip } from 'folds';
|
||||
import { Icon, Icons } from '../icons';
|
||||
import Linkify from 'linkify-react';
|
||||
import { Icon, Icons } from '../icons';
|
||||
import { mxcUrlToHttp } from '../../utils/matrix';
|
||||
import { useMatrixClient } from '../../hooks/useMatrixClient';
|
||||
import { nameInitials } from '../../utils/common';
|
||||
@@ -43,7 +43,7 @@ export function ImagePackProfile({ meta, canEdit, onEdit }: ImagePackProfileProp
|
||||
const mx = useMatrixClient();
|
||||
const useAuthentication = useMediaAuthentication();
|
||||
const avatarUrl = meta.avatar
|
||||
? mxcUrlToHttp(mx, meta.avatar, useAuthentication) ?? undefined
|
||||
? (mxcUrlToHttp(mx, meta.avatar, useAuthentication) ?? undefined)
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
@@ -91,7 +91,7 @@ export function ImagePackProfileEdit({ meta, onCancel, onSave }: ImagePackProfil
|
||||
const useAuthentication = useMediaAuthentication();
|
||||
const [avatar, setAvatar] = useState(meta.avatar);
|
||||
|
||||
const avatarUrl = avatar ? mxcUrlToHttp(mx, avatar, useAuthentication) ?? undefined : undefined;
|
||||
const avatarUrl = avatar ? (mxcUrlToHttp(mx, avatar, useAuthentication) ?? undefined) : undefined;
|
||||
|
||||
const [imageFile, setImageFile] = useState<File>();
|
||||
const avatarFileUrl = useObjectURL(imageFile);
|
||||
|
||||
@@ -32,7 +32,7 @@ export function RoomImagePack({ room, stateKey }: RoomImagePackProps) {
|
||||
{
|
||||
roomId: room.roomId,
|
||||
stateKey,
|
||||
}
|
||||
},
|
||||
);
|
||||
}, [room.roomId, stateKey]);
|
||||
const imagePack = useRoomImagePack(room, stateKey) ?? fallbackPack;
|
||||
@@ -46,10 +46,10 @@ export function RoomImagePack({ room, stateKey }: RoomImagePackProps) {
|
||||
address.roomId,
|
||||
StateEvent.PoniesRoomEmotes,
|
||||
packContent,
|
||||
address.stateKey
|
||||
address.stateKey,
|
||||
);
|
||||
},
|
||||
[mx, imagePack]
|
||||
[mx, imagePack],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { MouseEventHandler, useMemo, useState } from 'react';
|
||||
import { Box, Button, config, Menu, MenuItem, PopOut, RectCords, Text } from 'folds';
|
||||
import { Icon, Icons } from '../icons';
|
||||
import FocusTrap from 'focus-trap-react';
|
||||
import { Icon, Icons } from '../icons';
|
||||
import { ImageUsage } from '../../plugins/custom-emoji';
|
||||
import { stopPropagation } from '../../utils/keyboard';
|
||||
|
||||
@@ -30,7 +30,7 @@ export function UsageSelector({ selected, onChange }: UsageSelectorProps) {
|
||||
|
||||
const allUsages: ImageUsage[][] = useMemo(
|
||||
() => [[ImageUsage.Emoticon], [ImageUsage.Sticker], [ImageUsage.Sticker, ImageUsage.Emoticon]],
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -15,7 +15,7 @@ export function UserImagePack() {
|
||||
async (packContent: PackContent) => {
|
||||
await mx.setAccountData(AccountDataEvent.PoniesUserEmotes, packContent);
|
||||
},
|
||||
[mx]
|
||||
[mx],
|
||||
);
|
||||
|
||||
return <ImagePackContent imagePack={imagePack ?? defaultPack} canEdit onUpdate={handleUpdate} />;
|
||||
|
||||
Reference in New Issue
Block a user