mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-29 02:43:28 +03:00
chore: unified mui compoent entry to ui file
This commit is contained in:
parent
5c8041a8d4
commit
980786c821
@ -14,8 +14,8 @@ import {
|
|||||||
UndoIcon,
|
UndoIcon,
|
||||||
RedoIcon,
|
RedoIcon,
|
||||||
} from './Icons';
|
} from './Icons';
|
||||||
|
import { MuiSlide } from '@/ui/mui';
|
||||||
import { Tooltip } from '@/ui/tooltip';
|
import { Tooltip } from '@/ui/tooltip';
|
||||||
import Slide from '@mui/material/Slide';
|
|
||||||
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
|
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
|
||||||
import { useAppState } from '@/providers/app-state-provider';
|
import { useAppState } from '@/providers/app-state-provider';
|
||||||
import useHistoryUpdated from '@/hooks/use-history-update';
|
import useHistoryUpdated from '@/hooks/use-history-update';
|
||||||
@ -127,7 +127,7 @@ export const EdgelessToolbar = () => {
|
|||||||
const { mode } = useCurrentPageMeta() || {};
|
const { mode } = useCurrentPageMeta() || {};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Slide
|
<MuiSlide
|
||||||
direction="right"
|
direction="right"
|
||||||
in={mode === 'edgeless'}
|
in={mode === 'edgeless'}
|
||||||
mountOnEnter
|
mountOnEnter
|
||||||
@ -155,7 +155,7 @@ export const EdgelessToolbar = () => {
|
|||||||
</StyledToolbarWrapper>
|
</StyledToolbarWrapper>
|
||||||
<UndoRedo />
|
<UndoRedo />
|
||||||
</StyledEdgelessToolbar>
|
</StyledEdgelessToolbar>
|
||||||
</Slide>
|
</MuiSlide>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
StyledBrowserWarning,
|
StyledBrowserWarning,
|
||||||
StyledCloseButton,
|
StyledCloseButton,
|
||||||
} from './styles';
|
} from './styles';
|
||||||
import CloseIcon from '@mui/icons-material/Close';
|
import { CloseIcon } from '@blocksuite/icons';
|
||||||
import { useWarningMessage, shouldShowWarning } from './utils';
|
import { useWarningMessage, shouldShowWarning } from './utils';
|
||||||
import EditorOptionMenu from './header-right-items/EditorOptionMenu';
|
import EditorOptionMenu from './header-right-items/EditorOptionMenu';
|
||||||
import TrashButtonGroup from './header-right-items/TrashButtonGroup';
|
import TrashButtonGroup from './header-right-items/TrashButtonGroup';
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
StyledTransformIcon,
|
StyledTransformIcon,
|
||||||
} from './style';
|
} from './style';
|
||||||
import { CloseIcon, ContactIcon, HelpIcon, KeyboardIcon } from './Icons';
|
import { CloseIcon, ContactIcon, HelpIcon, KeyboardIcon } from './Icons';
|
||||||
import Grow from '@mui/material/Grow';
|
import { MuiGrow } from '@/ui/mui';
|
||||||
import { Tooltip } from '@/ui/tooltip';
|
import { Tooltip } from '@/ui/tooltip';
|
||||||
import { useTranslation } from '@affine/i18n';
|
import { useTranslation } from '@affine/i18n';
|
||||||
import { useModal } from '@/providers/GlobalModalProvider';
|
import { useModal } from '@/providers/GlobalModalProvider';
|
||||||
@ -35,7 +35,7 @@ export const HelpIsland = ({
|
|||||||
setShowContent(false);
|
setShowContent(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Grow in={showContent}>
|
<MuiGrow in={showContent}>
|
||||||
<StyledIslandWrapper>
|
<StyledIslandWrapper>
|
||||||
{showList.includes('contact') && (
|
{showList.includes('contact') && (
|
||||||
<Tooltip content={t('Contact Us')} placement="left-end">
|
<Tooltip content={t('Contact Us')} placement="left-end">
|
||||||
@ -66,7 +66,7 @@ export const HelpIsland = ({
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
</StyledIslandWrapper>
|
</StyledIslandWrapper>
|
||||||
</Grow>
|
</MuiGrow>
|
||||||
|
|
||||||
<div style={{ position: 'relative' }}>
|
<div style={{ position: 'relative' }}>
|
||||||
<StyledIconWrapper
|
<StyledIconWrapper
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
useWindowsKeyboardShortcuts,
|
useWindowsKeyboardShortcuts,
|
||||||
useWinMarkdownShortcuts,
|
useWinMarkdownShortcuts,
|
||||||
} from '@/components/shortcuts-modal/config';
|
} from '@/components/shortcuts-modal/config';
|
||||||
import Slide from '@mui/material/Slide';
|
import { MuiSlide } from '@/ui/mui';
|
||||||
import { ModalCloseButton } from '@/ui/modal';
|
import { ModalCloseButton } from '@/ui/modal';
|
||||||
import { getUaHelper } from '@/utils';
|
import { getUaHelper } from '@/utils';
|
||||||
import { useTranslation } from '@affine/i18n';
|
import { useTranslation } from '@affine/i18n';
|
||||||
@ -40,7 +40,7 @@ export const ShortcutsModal = ({ open, onClose }: ModalProps) => {
|
|||||||
: windowsKeyboardShortcuts;
|
: windowsKeyboardShortcuts;
|
||||||
|
|
||||||
return createPortal(
|
return createPortal(
|
||||||
<Slide direction="left" in={open} mountOnEnter unmountOnExit>
|
<MuiSlide direction="left" in={open} mountOnEnter unmountOnExit>
|
||||||
<StyledShortcutsModal data-testid="shortcuts-modal">
|
<StyledShortcutsModal data-testid="shortcuts-modal">
|
||||||
<>
|
<>
|
||||||
<StyledModalHeader>
|
<StyledModalHeader>
|
||||||
@ -81,7 +81,7 @@ export const ShortcutsModal = ({ open, onClose }: ModalProps) => {
|
|||||||
})}
|
})}
|
||||||
</>
|
</>
|
||||||
</StyledShortcutsModal>
|
</StyledShortcutsModal>
|
||||||
</Slide>,
|
</MuiSlide>,
|
||||||
document.body
|
document.body
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { displayFlex, styled } from '@/styles';
|
import { displayFlex, styled } from '@/styles';
|
||||||
import MuiAvatar from '@mui/material/Avatar';
|
import { MuiAvatar } from '@/ui/mui';
|
||||||
import IconButton from '@/ui/button/IconButton';
|
import IconButton from '@/ui/button/IconButton';
|
||||||
import Input from '@/ui/input';
|
import Input from '@/ui/input';
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { Modal, ModalWrapper, ModalCloseButton } from '@/ui/modal';
|
|||||||
import { Button } from '@/ui/button';
|
import { Button } from '@/ui/button';
|
||||||
import Input from '@/ui/input';
|
import Input from '@/ui/input';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Avatar } from '@mui/material';
|
import { MuiAvatar } from '@/ui/mui';
|
||||||
import useMembers from '@/hooks/use-members';
|
import useMembers from '@/hooks/use-members';
|
||||||
import { User } from '@affine/datacenter';
|
import { User } from '@affine/datacenter';
|
||||||
import { useTranslation } from '@affine/i18n';
|
import { useTranslation } from '@affine/i18n';
|
||||||
@ -102,7 +102,7 @@ export const InviteMemberModal = ({
|
|||||||
) : (
|
) : (
|
||||||
<Member>
|
<Member>
|
||||||
{userData?.avatar ? (
|
{userData?.avatar ? (
|
||||||
<Avatar src={userData?.avatar}></Avatar>
|
<MuiAvatar src={userData?.avatar}></MuiAvatar>
|
||||||
) : (
|
) : (
|
||||||
<MemberIcon>
|
<MemberIcon>
|
||||||
<EmailIcon></EmailIcon>
|
<EmailIcon></EmailIcon>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { styled } from '@/styles';
|
import { styled } from '@/styles';
|
||||||
import MuiAvatar from '@mui/material/Avatar';
|
import { MuiAvatar } from '@/ui/mui';
|
||||||
|
|
||||||
export const StyledMemberTitleContainer = styled('li')(() => {
|
export const StyledMemberTitleContainer = styled('li')(() => {
|
||||||
return {
|
return {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import MuiAvatar from '@mui/material/Avatar';
|
import { MuiAvatar } from '@/ui/mui';
|
||||||
import { styled } from '@/styles';
|
import { styled } from '@/styles';
|
||||||
|
|
||||||
export const WorkspaceItemWrapper = styled('div')(({ theme }) => ({
|
export const WorkspaceItemWrapper = styled('div')(({ theme }) => ({
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import MuiAvatar from '@mui/material/Avatar';
|
import { MuiAvatar } from '@/ui/mui';
|
||||||
import { styled } from '@/styles';
|
import { styled } from '@/styles';
|
||||||
import { StyledPopperContainer } from '@/ui/shared/Container';
|
import { StyledPopperContainer } from '@/ui/shared/Container';
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ import {
|
|||||||
StyledSubListItem,
|
StyledSubListItem,
|
||||||
} from './style';
|
} from './style';
|
||||||
import { Arrow } from './icons';
|
import { Arrow } from './icons';
|
||||||
import Collapse from '@mui/material/Collapse';
|
|
||||||
import {
|
import {
|
||||||
ArrowDownIcon,
|
ArrowDownIcon,
|
||||||
SearchIcon,
|
SearchIcon,
|
||||||
@ -23,6 +22,7 @@ import {
|
|||||||
SettingsIcon,
|
SettingsIcon,
|
||||||
} from '@blocksuite/icons';
|
} from '@blocksuite/icons';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
import { MuiCollapse } from '@/ui/mui';
|
||||||
import { Tooltip } from '@/ui/tooltip';
|
import { Tooltip } from '@/ui/tooltip';
|
||||||
import { useModal } from '@/providers/GlobalModalProvider';
|
import { useModal } from '@/providers/GlobalModalProvider';
|
||||||
import { useAppState } from '@/providers/app-state-provider';
|
import { useAppState } from '@/providers/app-state-provider';
|
||||||
@ -39,7 +39,7 @@ const FavoriteList = ({ showList }: { showList: boolean }) => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const favoriteList = pageList.filter(p => p.favorite && !p.trash);
|
const favoriteList = pageList.filter(p => p.favorite && !p.trash);
|
||||||
return (
|
return (
|
||||||
<Collapse in={showList}>
|
<MuiCollapse in={showList}>
|
||||||
{favoriteList.map((pageMeta, index) => {
|
{favoriteList.map((pageMeta, index) => {
|
||||||
const active = router.query.pageId === pageMeta.id;
|
const active = router.query.pageId === pageMeta.id;
|
||||||
return (
|
return (
|
||||||
@ -61,7 +61,7 @@ const FavoriteList = ({ showList }: { showList: boolean }) => {
|
|||||||
{favoriteList.length === 0 && (
|
{favoriteList.length === 0 && (
|
||||||
<StyledSubListItem disable={true}>{t('No item')}</StyledSubListItem>
|
<StyledSubListItem disable={true}>{t('No item')}</StyledSubListItem>
|
||||||
)}
|
)}
|
||||||
</Collapse>
|
</MuiCollapse>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export const WorkSpaceSliderBar = () => {
|
export const WorkSpaceSliderBar = () => {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { useWorkspaceHelper } from '@/hooks/use-workspace-helper';
|
import { useWorkspaceHelper } from '@/hooks/use-workspace-helper';
|
||||||
import { styled } from '@/styles';
|
import { styled } from '@/styles';
|
||||||
import { Empty } from '@/ui/empty';
|
import { Empty } from '@/ui/empty';
|
||||||
// import { Avatar } from '@mui/material';
|
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
7
packages/app/src/ui/mui.ts
Normal file
7
packages/app/src/ui/mui.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import MuiBreadcrumbs from '@mui/material/Breadcrumbs';
|
||||||
|
import MuiCollapse from '@mui/material/Collapse';
|
||||||
|
import MuiSlide from '@mui/material/Slide';
|
||||||
|
import MuiAvatar from '@mui/material/Avatar';
|
||||||
|
import MuiGrow from '@mui/material/Grow';
|
||||||
|
|
||||||
|
export { MuiBreadcrumbs, MuiCollapse, MuiSlide, MuiAvatar, MuiGrow };
|
Loading…
Reference in New Issue
Block a user