refactor!: next generation AFFiNE code structure (#1176)

This commit is contained in:
Himself65
2023-03-01 01:40:01 -06:00
committed by GitHub
parent 2dcccc772c
commit e0481d29ad
270 changed files with 8308 additions and 6829 deletions
@@ -0,0 +1,44 @@
import { useTranslation } from '@affine/i18n';
import {
DeleteTemporarilyIcon,
FavoriteIcon,
FolderIcon,
SettingsIcon,
} from '@blocksuite/icons';
import { FC, SVGProps, useMemo } from 'react';
import { pathGenerator } from '../../../shared';
export const useSwitchToConfig = (
workspaceId: string
): {
title: string;
href: string;
icon: FC<SVGProps<SVGSVGElement>>;
}[] => {
const { t } = useTranslation();
return useMemo(
() => [
{
title: t('All pages'),
href: pathGenerator.all(workspaceId),
icon: FolderIcon,
},
{
title: t('Favorites'),
href: pathGenerator.favorite(workspaceId),
icon: FavoriteIcon,
},
{
title: t('Workspace Settings'),
href: pathGenerator.setting(workspaceId),
icon: SettingsIcon,
},
{
title: t('Trash'),
href: pathGenerator.trash(workspaceId),
icon: DeleteTemporarilyIcon,
},
],
[workspaceId, t]
);
};