Fun picker improvements
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import type { MouseEvent, ReactNode } from 'react';
|
||||
import type { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
||||
import React from 'react';
|
||||
import { FunImage } from './FunImage';
|
||||
|
||||
/**
|
||||
* Button
|
||||
@@ -10,9 +9,8 @@ import { FunImage } from './FunImage';
|
||||
|
||||
export type FunItemButtonProps = Readonly<{
|
||||
'aria-label': string;
|
||||
'aria-describedby'?: string;
|
||||
tabIndex: number;
|
||||
onClick: (event: MouseEvent) => void;
|
||||
onClick: (event: ReactMouseEvent) => void;
|
||||
children: ReactNode;
|
||||
}>;
|
||||
|
||||
@@ -22,7 +20,6 @@ export function FunItemButton(props: FunItemButtonProps): JSX.Element {
|
||||
type="button"
|
||||
className="FunItem__Button"
|
||||
aria-label={props['aria-label']}
|
||||
aria-describedby={props['aria-describedby']}
|
||||
onClick={props.onClick}
|
||||
tabIndex={props.tabIndex}
|
||||
>
|
||||
@@ -30,48 +27,3 @@ export function FunItemButton(props: FunItemButtonProps): JSX.Element {
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sticker
|
||||
*/
|
||||
|
||||
export type FunItemStickerProps = Readonly<{
|
||||
src: string;
|
||||
}>;
|
||||
|
||||
export function FunItemSticker(props: FunItemStickerProps): JSX.Element {
|
||||
return (
|
||||
<FunImage
|
||||
role="presentation"
|
||||
className="FunItem__Sticker"
|
||||
src={props.src}
|
||||
width={68}
|
||||
height={68}
|
||||
alt=""
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gif
|
||||
*/
|
||||
|
||||
export type FunItemGifProps = Readonly<{
|
||||
src: string;
|
||||
width: number;
|
||||
height: number;
|
||||
}>;
|
||||
|
||||
export function FunItemGif(props: FunItemGifProps): JSX.Element {
|
||||
return (
|
||||
<FunImage
|
||||
role="presentation"
|
||||
className="FunItem__Gif"
|
||||
src={props.src}
|
||||
width={props.width}
|
||||
height={props.height}
|
||||
// For presentation only
|
||||
alt=""
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user