chore: fix code style issues (#4857)

This commit is contained in:
EYHN
2023-11-08 13:51:08 +08:00
committed by GitHub
parent 83472cc682
commit b7edaab387
30 changed files with 423 additions and 471 deletions
@@ -9,7 +9,7 @@ export type Notification = {
theme?: 'light' | 'dark' | 'default';
timeout?: number;
progressingBar?: boolean;
multimedia?: React.ReactNode | JSX.Element | HTMLElement;
multimedia?: React.ReactNode | JSX.Element;
// actions
undo?: () => Promise<void>;
};
@@ -7,7 +7,7 @@ import * as Toast from '@radix-ui/react-toast';
import { IconButton } from '@toeverything/components/button';
import clsx from 'clsx';
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
import type { ReactElement } from 'react';
import type { ReactNode } from 'react';
import {
useCallback,
useEffect,
@@ -70,7 +70,7 @@ const typeColorMap = {
},
};
function NotificationCard(props: NotificationCardProps): ReactElement {
function NotificationCard(props: NotificationCardProps): ReactNode {
const removeNotification = useSetAtom(removeNotificationAtom);
const { notification, notifications, setHeights, heights, index } = props;
@@ -270,7 +270,7 @@ function NotificationCard(props: NotificationCardProps): ReactElement {
>
{notification.multimedia ? (
<div className={styles.notificationMultimediaStyle}>
<>{notification.multimedia}</>
{notification.multimedia}
<IconButton className={styles.closeButtonWithMediaStyle}>
<CloseIcon onClick={onClickRemove} />
</IconButton>
@@ -373,7 +373,7 @@ function NotificationCard(props: NotificationCardProps): ReactElement {
);
}
export function NotificationCenter(): ReactElement {
export function NotificationCenter(): ReactNode {
const notifications = useAtomValue(notificationsAtom);
const [expand, setExpand] = useAtom(expandNotificationCenterAtom);
@@ -390,7 +390,7 @@ export function NotificationCenter(): ReactElement {
}
}, [notifications, setExpand]);
if (!notifications.length) return <></>;
if (!notifications.length) return null;
return (
<Toast.Provider swipeDirection="right">
{notifications.map((notification, index) =>