continue polish, prepare launch v1.0.0

This commit is contained in:
Ren Amamiya
2023-06-22 14:17:48 +07:00
parent 699a26b3f0
commit a71e2991c2
14 changed files with 64 additions and 121 deletions

View File

@@ -1,14 +1,8 @@
import { DEFAULT_AVATAR } from "@stores/constants";
import { ClassAttributes, ImgHTMLAttributes, JSX } from "react";
export function Image(
props: JSX.IntrinsicAttributes &
ClassAttributes<HTMLImageElement> &
ImgHTMLAttributes<HTMLImageElement>,
fallback = undefined,
) {
export function Image(props, fallback?) {
const addImageFallback = (event: { currentTarget: { src: string } }) => {
event.currentTarget.src = fallback ? fallback : DEFAULT_AVATAR;
event.currentTarget.src = fallback || DEFAULT_AVATAR;
};
return (