(feat): improved mobile notifications
(feat): add lint rules (feat): improve markdown inline code box
This commit is contained in:
parent
336b9464c9
commit
4a841de073
35 changed files with 777 additions and 287 deletions
|
|
@ -34,35 +34,25 @@ function getColumnCount(width: number, itemCount: number) {
|
|||
|
||||
type KlipyKind = "gif" | "meme";
|
||||
|
||||
type KlipyMediaFile = {
|
||||
url?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
};
|
||||
|
||||
type KlipyMediaFormats = Record<string, KlipyMediaFile | undefined>;
|
||||
|
||||
type KlipyItem = {
|
||||
id: number | string;
|
||||
title?: string;
|
||||
file?: Record<string, KlipyMediaFormats | undefined>;
|
||||
file?: Record<
|
||||
string,
|
||||
| Record<
|
||||
string,
|
||||
| {
|
||||
url?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
| undefined
|
||||
>
|
||||
| undefined
|
||||
>;
|
||||
blur_preview?: string;
|
||||
};
|
||||
|
||||
type KlipyPage = {
|
||||
items: KlipyItem[];
|
||||
currentPage: number;
|
||||
hasNext: boolean;
|
||||
};
|
||||
|
||||
type KlipyResponse = {
|
||||
data?: {
|
||||
data?: KlipyItem[];
|
||||
current_page?: number;
|
||||
has_next?: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
type PickerMedia = {
|
||||
key: React.Key;
|
||||
url: string;
|
||||
|
|
@ -105,7 +95,11 @@ async function fetchKlipyPage({
|
|||
kind: KlipyKind;
|
||||
page: number;
|
||||
search: string;
|
||||
}): Promise<KlipyPage> {
|
||||
}): Promise<{
|
||||
items: KlipyItem[];
|
||||
currentPage: number;
|
||||
hasNext: boolean;
|
||||
}> {
|
||||
const params = new URLSearchParams({
|
||||
page: String(page),
|
||||
per_page: String(pageSize),
|
||||
|
|
@ -128,7 +122,13 @@ async function fetchKlipyPage({
|
|||
throw new Error(`Klipy request failed with status ${response.status}`);
|
||||
}
|
||||
|
||||
const body = (await response.json()) as KlipyResponse;
|
||||
const body = (await response.json()) as {
|
||||
data?: {
|
||||
data?: KlipyItem[];
|
||||
current_page?: number;
|
||||
has_next?: boolean;
|
||||
};
|
||||
};
|
||||
const data = body.data;
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -66,6 +66,13 @@ export default function InputComponent({
|
|||
return () => cancelAnimationFrame(frame);
|
||||
}, [userId]);
|
||||
|
||||
useEffect(() => {
|
||||
if (replyTo === undefined) return;
|
||||
|
||||
const frame = requestAnimationFrame(() => composerRef.current?.focus());
|
||||
return () => cancelAnimationFrame(frame);
|
||||
}, [replyTo]);
|
||||
|
||||
useEffect(() => {
|
||||
const focusComposerOnType = (event: KeyboardEvent) => {
|
||||
const composer = composerRef.current;
|
||||
|
|
|
|||
Loading…
Reference in a new issue