refactor(infra): directory structure (#4615)

This commit is contained in:
Joooye_34
2023-10-18 23:30:08 +08:00
committed by GitHub
parent 814d552be8
commit bed9310519
1150 changed files with 539 additions and 584 deletions
@@ -0,0 +1,45 @@
import { globalStyle, style } from '@vanilla-extract/css';
export const importPageContainerStyle = style({
position: 'relative',
display: 'flex',
width: '480px',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
borderRadius: '12px',
boxShadow: 'var(--affine-popover-shadow)',
background: 'var(--affine-background-overlay-panel-color)',
overflow: 'hidden',
});
export const importPageBodyStyle = style({
display: 'flex',
padding: '32px 40px 20px 40px',
flexDirection: 'column',
gap: '20px',
alignSelf: 'stretch',
});
export const importPageButtonContainerStyle = style({
display: 'grid',
gridTemplateColumns: '1fr 1fr',
padding: '0px 40px 36px',
flexDirection: 'column',
alignItems: 'center',
gap: '20px',
alignSelf: 'stretch',
});
globalStyle(`${importPageBodyStyle} .title`, {
fontSize: 'var(--affine-font-h-6)',
fontWeight: 600,
});
globalStyle(`${importPageBodyStyle} a`, {
whiteSpace: 'nowrap',
wordBreak: 'break-word',
color: 'var(--affine-link-color)',
textDecoration: 'none',
cursor: 'pointer',
});
@@ -0,0 +1,86 @@
import {
CloseIcon,
ExportToHtmlIcon,
ExportToMarkdownIcon,
HelpIcon,
NewIcon,
NotionIcon,
} from '@blocksuite/icons';
import { IconButton } from '@toeverything/components/button';
import { Tooltip } from '@toeverything/components/tooltip';
import { BlockCard } from '../card/block-card';
import {
importPageBodyStyle,
importPageButtonContainerStyle,
importPageContainerStyle,
} from './index.css';
export const ImportPage = ({
importMarkdown,
importHtml,
importNotion,
onClose,
}: {
importMarkdown: () => void;
importHtml: () => void;
importNotion: () => void;
onClose: () => void;
}) => (
<div className={importPageContainerStyle}>
<IconButton
style={{
position: 'absolute',
right: 6,
top: 6,
}}
onClick={() => {
onClose();
}}
icon={<CloseIcon />}
/>
<div className={importPageBodyStyle}>
<div className="title">Import</div>
<span>
AFFiNE will gradually support more and more file types for import.&nbsp;
<a
href="https://community.affine.pro/c/feature-requests/import-export"
target="_blank"
rel="noreferrer"
>
Provide feedback.
</a>
</span>
</div>
<div className={importPageButtonContainerStyle}>
<BlockCard
left={<ExportToMarkdownIcon width={20} height={20} />}
title="Markdown"
onClick={importMarkdown}
/>
<BlockCard
left={<ExportToHtmlIcon width={20} height={20} />}
title="HTML"
onClick={importHtml}
/>
<BlockCard
left={<NotionIcon width={20} height={20} />}
title="Notion"
right={
<Tooltip
content={'Learn how to Import your Notion pages into AFFiNE.'}
>
<HelpIcon width={20} height={20} />
</Tooltip>
}
onClick={importNotion}
/>
<BlockCard
left={<NewIcon width={20} height={20} />}
title="Coming soon..."
disabled
onClick={importHtml}
/>
</div>
</div>
);