chore: reduce code by gndelia/codemod-replace-react-fc-typescript

This commit is contained in:
DarkSky
2022-08-12 01:26:27 +08:00
parent b4f56cda59
commit 40b617c429
73 changed files with 108 additions and 115 deletions

View File

@@ -8,7 +8,7 @@ interface StatusTrackProps {
onClick: () => void;
}
export const StatusTrack: FC<StatusTrackProps> = ({ mode, onClick }) => {
export const StatusTrack = ({ mode, onClick }: StatusTrackProps) => {
return (
<Container onClick={onClick}>
<StatusIcon mode={mode} />

View File

@@ -3,7 +3,7 @@ import { styled } from '@toeverything/components/ui';
import { LastModified } from './LastModified';
import { Logout } from './Logout';
export const Footer: FC = () => {
export const Footer = () => {
return (
<Container>
<LastModified />

View File

@@ -4,7 +4,7 @@ import { Typography, styled } from '@toeverything/components/ui';
import { useUserAndSpaces } from '@toeverything/datasource/state';
import { usePageLastUpdated, useWorkspaceAndPageId } from '../util';
export const LastModified: FC = () => {
export const LastModified = () => {
const { user } = useUserAndSpaces();
const username = user ? user.nickname : 'Anonymous';
const { workspaceId, pageId } = useWorkspaceAndPageId();

View File

@@ -21,7 +21,7 @@ const logout = () => {
window.location.href = '/';
};
export const Logout: FC = () => {
export const Logout = () => {
return (
<ListItem onClick={logout}>
<StyledIcon />