mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 13:57:02 +08:00
chore: reduce code by gndelia/codemod-replace-react-fc-typescript
This commit is contained in:
@@ -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} />
|
||||
|
||||
@@ -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 />
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -21,7 +21,7 @@ const logout = () => {
|
||||
window.location.href = '/';
|
||||
};
|
||||
|
||||
export const Logout: FC = () => {
|
||||
export const Logout = () => {
|
||||
return (
|
||||
<ListItem onClick={logout}>
|
||||
<StyledIcon />
|
||||
|
||||
Reference in New Issue
Block a user