feat(core): add history tips modal (#5733)
close TOV-459 TOV-503 https://github.com/toeverything/AFFiNE/assets/102217452/9cbfaf35-bc7b-4275-94be-6e777447ef11
This commit is contained in:
6 files changed
+392
-7
No files matched your search
@@ -15,6 +15,7 @@ export const openPaymentDisableAtom = atom(false);
|
||||
export const openQuotaModalAtom = atom(false);
|
||||
export const openStarAFFiNEModalAtom = atom(false);
|
||||
export const openIssueFeedbackModalAtom = atom(false);
|
||||
export const openHistoryTipsModalAtom = atom(false);
|
||||
|
||||
export type SettingAtom = Pick<
|
||||
SettingProps,
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
import { OverlayModal } from '@affine/component';
|
||||
import {
|
||||
openDisableCloudAlertModalAtom,
|
||||
openHistoryTipsModalAtom,
|
||||
} from '@affine/core/atoms';
|
||||
import { useAsyncCallback } from '@affine/core/hooks/affine-async-hooks';
|
||||
import { useNavigateHelper } from '@affine/core/hooks/use-navigate-helper';
|
||||
import { WorkspaceSubPath } from '@affine/core/shared';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import { useService, Workspace, WorkspaceManager } from '@toeverything/infra';
|
||||
import { useAtom, useSetAtom } from 'jotai';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { EnableAffineCloudModal } from '../enable-affine-cloud-modal';
|
||||
import TopSvg from './top-svg';
|
||||
|
||||
export const HistoryTipsModal = () => {
|
||||
const t = useAFFiNEI18N();
|
||||
const { openPage } = useNavigateHelper();
|
||||
const workspaceManager = useService(WorkspaceManager);
|
||||
const currentWorkspace = useService(Workspace);
|
||||
const [open, setOpen] = useAtom(openHistoryTipsModalAtom);
|
||||
const setTempDisableCloudOpen = useSetAtom(openDisableCloudAlertModalAtom);
|
||||
const [openEnableCloudModal, setOpenEnableCloudModal] = useState(false);
|
||||
|
||||
const handleConfirm = useCallback(() => {
|
||||
setOpen(false);
|
||||
if (runtimeConfig.enableCloud) {
|
||||
return setOpenEnableCloudModal(true);
|
||||
}
|
||||
return setTempDisableCloudOpen(true);
|
||||
}, [setOpen, setTempDisableCloudOpen]);
|
||||
|
||||
const handEnableCloud = useAsyncCallback(async () => {
|
||||
if (!currentWorkspace) {
|
||||
return;
|
||||
}
|
||||
const { id: newId } =
|
||||
await workspaceManager.transformLocalToCloud(currentWorkspace);
|
||||
openPage(newId, WorkspaceSubPath.ALL);
|
||||
setOpenEnableCloudModal(false);
|
||||
}, [openPage, currentWorkspace, workspaceManager]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<OverlayModal
|
||||
open={open}
|
||||
topImage={<TopSvg />}
|
||||
title={t['com.affine.history-vision.tips-modal.title']()}
|
||||
onOpenChange={setOpen}
|
||||
description={t['com.affine.history-vision.tips-modal.description']()}
|
||||
cancelText={t['com.affine.history-vision.tips-modal.cancel']()}
|
||||
confirmButtonOptions={{
|
||||
type: 'primary',
|
||||
}}
|
||||
onConfirm={handleConfirm}
|
||||
confirmText={t['com.affine.history-vision.tips-modal.confirm']()}
|
||||
/>
|
||||
<EnableAffineCloudModal
|
||||
open={openEnableCloudModal}
|
||||
onOpenChange={setOpenEnableCloudModal}
|
||||
onConfirm={handEnableCloud}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,299 @@
|
||||
import { cssVar } from '@toeverything/theme';
|
||||
|
||||
export default function TopSvg() {
|
||||
return (
|
||||
<svg
|
||||
width="400"
|
||||
height="220"
|
||||
viewBox="0 0 400 220"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<g clipPath="url(#clip0_5877_92351)">
|
||||
<g filter="url(#filter0_d_5877_92351)">
|
||||
<rect
|
||||
y="0.0753174"
|
||||
width="400"
|
||||
height="220"
|
||||
fill={cssVar('backgroundPrimaryColor')}
|
||||
/>
|
||||
</g>
|
||||
<rect
|
||||
x="16"
|
||||
y="10"
|
||||
width="64"
|
||||
height="32"
|
||||
rx="12"
|
||||
fill={cssVar('backgroundSecondaryColor')}
|
||||
/>
|
||||
<g filter="url(#filter1_d_5877_92351)">
|
||||
<rect
|
||||
x="20"
|
||||
y="14"
|
||||
width="24"
|
||||
height="24"
|
||||
rx="8"
|
||||
fill={cssVar('backgroundPrimaryColor')}
|
||||
shapeRendering="crispEdges"
|
||||
/>
|
||||
<g clipPath="url(#clip1_5877_92351)">
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M27.8334 18.7084C26.5677 18.7084 25.5417 19.7344 25.5417 21V31C25.5417 32.2657 26.5677 33.2917 27.8334 33.2917H36.1667C37.4323 33.2917 38.4584 32.2657 38.4584 31V21C38.4584 19.7344 37.4323 18.7084 36.1667 18.7084H27.8334ZM26.7917 21C26.7917 20.4247 27.2581 19.9584 27.8334 19.9584H36.1667C36.742 19.9584 37.2084 20.4247 37.2084 21V31C37.2084 31.5753 36.742 32.0417 36.1667 32.0417H27.8334C27.2581 32.0417 26.7917 31.5753 26.7917 31V21ZM29.5 22.0417C29.1548 22.0417 28.875 22.3215 28.875 22.6667C28.875 23.0119 29.1548 23.2917 29.5 23.2917H32.4167C32.7619 23.2917 33.0417 23.0119 33.0417 22.6667C33.0417 22.3215 32.7619 22.0417 32.4167 22.0417H29.5ZM28.875 25.5834C28.875 25.2382 29.1548 24.9584 29.5 24.9584H34.5C34.8452 24.9584 35.125 25.2382 35.125 25.5834C35.125 25.9286 34.8452 26.2084 34.5 26.2084H29.5C29.1548 26.2084 28.875 25.9286 28.875 25.5834ZM29.5 27.875C29.1548 27.875 28.875 28.1549 28.875 28.5C28.875 28.8452 29.1548 29.125 29.5 29.125H33.6667C34.0119 29.125 34.2917 28.8452 34.2917 28.5C34.2917 28.1549 34.0119 27.875 33.6667 27.875H29.5Z"
|
||||
fill={cssVar('primaryColor')}
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
<g clipPath="url(#clip2_5877_92351)">
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M59.9735 19.9584C59.1137 19.9584 58.4167 20.6554 58.4167 21.5152C58.4167 22.3751 59.1137 23.0721 59.9735 23.0721C60.8334 23.0721 61.5304 22.3751 61.5304 21.5152C61.5304 20.6554 60.8334 19.9584 59.9735 19.9584ZM57.1667 21.5152C57.1667 19.965 58.4234 18.7084 59.9735 18.7084C61.4604 18.7084 62.6772 19.8644 62.7742 21.3266C63.4762 21.3273 64.1503 21.3383 64.8517 21.5077C65.6295 21.6956 66.4061 22.0674 67.3305 22.7607L67.3475 22.7734L67.3636 22.7873C68.669 23.9126 69.3224 25.7317 69.326 27.4358H70.7084C71.0536 27.4358 71.3334 27.7156 71.3334 28.0608V31.9881C71.3334 32.3333 71.0536 32.6131 70.7084 32.6131H66.781C66.4359 32.6131 66.156 32.3333 66.156 31.9881V28.0608C66.156 27.7156 66.4359 27.4358 66.781 27.4358H68.076C68.0724 26.0148 67.5229 24.5853 66.563 23.7476C65.7506 23.1409 65.1313 22.8612 64.5582 22.7227C63.9652 22.5795 63.3858 22.5766 62.5918 22.5766V22.5289C62.2585 23.3891 61.5135 24.0442 60.5986 24.2523V27.5056C61.8479 27.7898 62.7804 28.9073 62.7804 30.2427C62.7804 31.7928 61.5237 33.0495 59.9735 33.0495C58.4234 33.0495 57.1667 31.7928 57.1667 30.2427C57.1667 28.9073 58.0992 27.7897 59.3486 27.5056V24.2523C58.0992 23.9682 57.1667 22.8506 57.1667 21.5152ZM59.9735 28.6858C59.1137 28.6858 58.4167 29.3828 58.4167 30.2427C58.4167 31.1025 59.1137 31.7995 59.9735 31.7995C60.8334 31.7995 61.5304 31.1025 61.5304 30.2427C61.5304 29.3828 60.8334 28.6858 59.9735 28.6858ZM67.406 31.3631V28.6858H70.0834V31.3631H67.406Z"
|
||||
fill={cssVar('iconColor')}
|
||||
/>
|
||||
</g>
|
||||
<rect
|
||||
x="92"
|
||||
y="10"
|
||||
width="128.528"
|
||||
height="32"
|
||||
rx="12"
|
||||
fill={cssVar('backgroundSecondaryColor')}
|
||||
/>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M238.998 23.4697C239.29 23.1768 239.765 23.1768 240.058 23.4697L244.174 27.5858C244.37 27.781 244.686 27.781 244.881 27.5858L248.998 23.4697C249.29 23.1768 249.765 23.1768 250.058 23.4697C250.351 23.7626 250.351 24.2374 250.058 24.5303L245.942 28.6464C245.161 29.4275 243.895 29.4275 243.114 28.6464L238.998 24.5303C238.705 24.2374 238.705 23.7626 238.998 23.4697Z"
|
||||
fill={cssVar('iconColor')}
|
||||
/>
|
||||
<g filter="url(#filter2_di_5877_92351)">
|
||||
<rect
|
||||
x="107.402"
|
||||
y="32.1934"
|
||||
width="211.325"
|
||||
height="221.308"
|
||||
rx="8"
|
||||
stroke={cssVar('borderColor')}
|
||||
fill={cssVar('backgroundOverlayPanelColor')}
|
||||
/>
|
||||
</g>
|
||||
<rect
|
||||
x="120"
|
||||
y="49"
|
||||
width="183.726"
|
||||
height="18"
|
||||
rx="4"
|
||||
fill={cssVar('backgroundSecondaryColor')}
|
||||
/>
|
||||
<rect
|
||||
x="120"
|
||||
y="77"
|
||||
width="183.726"
|
||||
height="18"
|
||||
rx="4"
|
||||
fill={cssVar('backgroundSecondaryColor')}
|
||||
/>
|
||||
<rect
|
||||
x="120"
|
||||
y="105"
|
||||
width="183.726"
|
||||
height="18"
|
||||
rx="4"
|
||||
fill={cssVar('backgroundSecondaryColor')}
|
||||
/>
|
||||
<rect
|
||||
x="120"
|
||||
y="133"
|
||||
width="183.726"
|
||||
height="18"
|
||||
rx="4"
|
||||
fill={cssVar('backgroundSecondaryColor')}
|
||||
/>
|
||||
<g clipPath="url(#clip3_5877_92351)">
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M137.973 171.496L137.972 171.497L136.958 172.412H138.25C138.595 172.412 138.875 172.692 138.875 173.037C138.875 173.382 138.595 173.662 138.25 173.662H135.333C134.988 173.662 134.708 173.382 134.708 173.037V170.167C134.708 169.822 134.988 169.542 135.333 169.542C135.678 169.542 135.958 169.822 135.958 170.167V171.631L137.139 170.565C138.428 169.411 140.133 168.708 142 168.708C146.027 168.708 149.292 171.973 149.292 176C149.292 180.027 146.027 183.292 142 183.292C138.529 183.292 135.626 180.867 134.889 177.62C134.813 177.283 135.024 176.948 135.36 176.872C135.697 176.796 136.032 177.007 136.108 177.343C136.719 180.034 139.125 182.042 142 182.042C145.337 182.042 148.042 179.337 148.042 176C148.042 172.663 145.337 169.958 142 169.958C140.453 169.958 139.043 170.539 137.973 171.496Z"
|
||||
fill={cssVar('iconColor')}
|
||||
/>
|
||||
<path
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M142 171.625C142.345 171.625 142.625 171.905 142.625 172.25V175.741L144.942 178.058C145.186 178.302 145.186 178.698 144.942 178.942C144.698 179.186 144.302 179.186 144.058 178.942L141.582 176.466C141.45 176.334 141.375 176.153 141.375 175.966V172.25C141.375 171.905 141.655 171.625 142 171.625Z"
|
||||
fill={cssVar('iconColor')}
|
||||
/>
|
||||
</g>
|
||||
<path
|
||||
d="M161.651 170.818L164.673 179.389H164.793L167.815 170.818H169.108L165.369 181H164.097L160.358 170.818H161.651ZM170.535 181V173.364H171.708V181H170.535ZM171.131 172.091C170.903 172.091 170.705 172.013 170.54 171.857C170.377 171.701 170.296 171.514 170.296 171.295C170.296 171.077 170.377 170.889 170.54 170.734C170.705 170.578 170.903 170.5 171.131 170.5C171.36 170.5 171.556 170.578 171.718 170.734C171.884 170.889 171.967 171.077 171.967 171.295C171.967 171.514 171.884 171.701 171.718 171.857C171.556 172.013 171.36 172.091 171.131 172.091ZM177.059 181.159C176.323 181.159 175.688 180.997 175.155 180.672C174.624 180.344 174.215 179.886 173.927 179.3C173.642 178.71 173.499 178.024 173.499 177.241C173.499 176.459 173.642 175.77 173.927 175.173C174.215 174.573 174.616 174.106 175.13 173.771C175.647 173.433 176.25 173.264 176.939 173.264C177.337 173.264 177.73 173.33 178.118 173.463C178.506 173.596 178.858 173.811 179.177 174.109C179.495 174.404 179.748 174.795 179.937 175.283C180.126 175.77 180.221 176.37 180.221 177.082V177.58H174.334V176.565H179.028C179.028 176.134 178.941 175.75 178.769 175.412C178.6 175.074 178.358 174.807 178.043 174.612C177.732 174.416 177.364 174.318 176.939 174.318C176.472 174.318 176.068 174.434 175.726 174.666C175.388 174.895 175.128 175.193 174.946 175.561C174.764 175.929 174.672 176.323 174.672 176.744V177.42C174.672 177.997 174.772 178.486 174.971 178.887C175.173 179.285 175.453 179.588 175.811 179.797C176.169 180.002 176.585 180.105 177.059 180.105C177.367 180.105 177.645 180.062 177.894 179.976C178.146 179.886 178.363 179.754 178.545 179.578C178.728 179.399 178.868 179.177 178.968 178.912L180.101 179.23C179.982 179.615 179.782 179.953 179.5 180.244C179.218 180.533 178.87 180.758 178.456 180.92C178.041 181.08 177.576 181.159 177.059 181.159ZM183.736 181L181.409 173.364H182.642L184.292 179.21H184.372L186.003 173.364H187.256L188.866 179.19H188.946L190.596 173.364H191.829L189.503 181H188.349L186.679 175.134H186.559L184.889 181H183.736ZM197.477 181V170.818H198.71V175.352H204.139V170.818H205.372V181H204.139V176.446H198.71V181H197.477ZM207.681 181V173.364H208.855V181H207.681ZM208.278 172.091C208.049 172.091 207.852 172.013 207.686 171.857C207.524 171.701 207.443 171.514 207.443 171.295C207.443 171.077 207.524 170.889 207.686 170.734C207.852 170.578 208.049 170.5 208.278 170.5C208.507 170.5 208.702 170.578 208.865 170.734C209.03 170.889 209.113 171.077 209.113 171.295C209.113 171.514 209.03 171.701 208.865 171.857C208.702 172.013 208.507 172.091 208.278 172.091ZM216.413 175.074L215.359 175.372C215.292 175.196 215.195 175.026 215.065 174.86C214.939 174.691 214.767 174.552 214.548 174.442C214.33 174.333 214.049 174.278 213.708 174.278C213.241 174.278 212.851 174.386 212.54 174.602C212.232 174.814 212.077 175.084 212.077 175.412C212.077 175.704 212.183 175.934 212.396 176.103C212.608 176.272 212.939 176.413 213.39 176.526L214.523 176.804C215.206 176.97 215.715 177.223 216.05 177.565C216.384 177.903 216.552 178.339 216.552 178.872C216.552 179.31 216.426 179.701 216.174 180.045C215.925 180.39 215.577 180.662 215.13 180.861C214.683 181.06 214.162 181.159 213.569 181.159C212.79 181.159 212.145 180.99 211.635 180.652C211.125 180.314 210.801 179.82 210.665 179.17L211.779 178.892C211.885 179.303 212.086 179.611 212.381 179.817C212.679 180.022 213.068 180.125 213.549 180.125C214.096 180.125 214.53 180.009 214.852 179.777C215.176 179.542 215.339 179.26 215.339 178.932C215.339 178.667 215.246 178.445 215.06 178.266C214.875 178.083 214.59 177.947 214.205 177.858L212.933 177.56C212.233 177.394 211.719 177.137 211.391 176.789C211.067 176.438 210.904 175.999 210.904 175.472C210.904 175.041 211.025 174.66 211.267 174.328C211.512 173.997 211.845 173.737 212.266 173.548C212.691 173.359 213.171 173.264 213.708 173.264C214.464 173.264 215.057 173.43 215.488 173.761C215.922 174.093 216.23 174.53 216.413 175.074ZM221.639 173.364V174.358H217.682V173.364H221.639ZM218.835 171.534H220.008V178.812C220.008 179.144 220.056 179.393 220.153 179.558C220.252 179.721 220.378 179.83 220.53 179.886C220.686 179.939 220.85 179.966 221.023 179.966C221.152 179.966 221.258 179.959 221.341 179.946C221.424 179.929 221.49 179.916 221.54 179.906L221.778 180.96C221.699 180.99 221.588 181.02 221.445 181.05C221.303 181.083 221.122 181.099 220.903 181.099C220.572 181.099 220.247 181.028 219.929 180.886C219.614 180.743 219.352 180.526 219.143 180.234C218.938 179.943 218.835 179.575 218.835 179.131V171.534ZM226.424 181.159C225.735 181.159 225.13 180.995 224.61 180.667C224.093 180.339 223.688 179.88 223.396 179.29C223.108 178.7 222.964 178.01 222.964 177.222C222.964 176.426 223.108 175.732 223.396 175.138C223.688 174.545 224.093 174.085 224.61 173.756C225.13 173.428 225.735 173.264 226.424 173.264C227.114 173.264 227.717 173.428 228.234 173.756C228.754 174.085 229.159 174.545 229.447 175.138C229.739 175.732 229.884 176.426 229.884 177.222C229.884 178.01 229.739 178.7 229.447 179.29C229.159 179.88 228.754 180.339 228.234 180.667C227Line truncated
|
||||
fill={cssVar('textPrimaryColor')}
|
||||
/>
|
||||
<rect
|
||||
x="120"
|
||||
y="201"
|
||||
width="183.726"
|
||||
height="18"
|
||||
rx="4"
|
||||
fill={cssVar('backgroundSecondaryColor')}
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter
|
||||
id="filter0_d_5877_92351"
|
||||
x="-7.65691"
|
||||
y="-7.5816"
|
||||
width="415.314"
|
||||
height="235.314"
|
||||
filterUnits="userSpaceOnUse"
|
||||
colorInterpolationFilters="sRGB"
|
||||
>
|
||||
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha"
|
||||
/>
|
||||
<feOffset />
|
||||
<feGaussianBlur stdDeviation="3.82846" />
|
||||
<feComposite in2="hardAlpha" operator="out" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="BackgroundImageFix"
|
||||
result="effect1_dropShadow_5877_92351"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect1_dropShadow_5877_92351"
|
||||
result="shape"
|
||||
/>
|
||||
</filter>
|
||||
<filter
|
||||
id="filter1_d_5877_92351"
|
||||
x="16"
|
||||
y="10"
|
||||
width="32"
|
||||
height="32"
|
||||
filterUnits="userSpaceOnUse"
|
||||
colorInterpolationFilters="sRGB"
|
||||
>
|
||||
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha"
|
||||
/>
|
||||
<feOffset />
|
||||
<feGaussianBlur stdDeviation="2" />
|
||||
<feComposite in2="hardAlpha" operator="out" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0.258824 0 0 0 0 0.254902 0 0 0 0 0.286275 0 0 0 0.14 0"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="BackgroundImageFix"
|
||||
result="effect1_dropShadow_5877_92351"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect1_dropShadow_5877_92351"
|
||||
result="shape"
|
||||
/>
|
||||
</filter>
|
||||
<filter
|
||||
id="filter2_di_5877_92351"
|
||||
x="95.4016"
|
||||
y="20.1934"
|
||||
width="235.325"
|
||||
height="245.308"
|
||||
filterUnits="userSpaceOnUse"
|
||||
colorInterpolationFilters="sRGB"
|
||||
>
|
||||
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha"
|
||||
/>
|
||||
<feOffset />
|
||||
<feGaussianBlur stdDeviation="6" />
|
||||
<feComposite in2="hardAlpha" operator="out" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0.258824 0 0 0 0 0.254902 0 0 0 0 0.286275 0 0 0 0.14 0"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="BackgroundImageFix"
|
||||
result="effect1_dropShadow_5877_92351"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
in2="effect1_dropShadow_5877_92351"
|
||||
result="shape"
|
||||
/>
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha"
|
||||
/>
|
||||
<feMorphology
|
||||
radius="0.5"
|
||||
operator="erode"
|
||||
in="SourceAlpha"
|
||||
result="effect2_innerShadow_5877_92351"
|
||||
/>
|
||||
<feOffset />
|
||||
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" />
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0"
|
||||
/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in2="shape"
|
||||
result="effect2_innerShadow_5877_92351"
|
||||
/>
|
||||
</filter>
|
||||
<clipPath id="clip0_5877_92351">
|
||||
<rect width="400" height="220" fill="white" />
|
||||
</clipPath>
|
||||
<clipPath id="clip1_5877_92351">
|
||||
<rect
|
||||
width="20"
|
||||
height="20"
|
||||
fill="white"
|
||||
transform="translate(22 16)"
|
||||
/>
|
||||
</clipPath>
|
||||
<clipPath id="clip2_5877_92351">
|
||||
<rect
|
||||
width="20"
|
||||
height="20"
|
||||
fill="white"
|
||||
transform="translate(54 16)"
|
||||
/>
|
||||
</clipPath>
|
||||
<clipPath id="clip3_5877_92351">
|
||||
<rect
|
||||
width="20"
|
||||
height="20"
|
||||
fill="white"
|
||||
transform="translate(132 166)"
|
||||
/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
MenuItem,
|
||||
MenuSeparator,
|
||||
} from '@affine/component/ui/menu';
|
||||
import { openHistoryTipsModalAtom } from '@affine/core/atoms';
|
||||
import { currentModeAtom } from '@affine/core/atoms/mode';
|
||||
import { PageHistoryModal } from '@affine/core/components/affine/page-history-modal';
|
||||
import { Export, MoveToTrash } from '@affine/core/components/page-list';
|
||||
@@ -26,7 +27,7 @@ import {
|
||||
PageIcon,
|
||||
} from '@blocksuite/icons';
|
||||
import { useService, Workspace } from '@toeverything/infra';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { useAtomValue, useSetAtom } from 'jotai';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { HeaderDropDownButton } from '../../../pure/header-drop-down-button';
|
||||
@@ -64,10 +65,14 @@ export const PageHeaderMenuButton = ({
|
||||
const { setTrashModal } = useTrashModalHelper(blockSuiteWorkspace);
|
||||
|
||||
const [historyModalOpen, setHistoryModalOpen] = useState(false);
|
||||
const setOpenHistoryTipsModal = useSetAtom(openHistoryTipsModalAtom);
|
||||
|
||||
const openHistoryModal = useCallback(() => {
|
||||
setHistoryModalOpen(true);
|
||||
}, []);
|
||||
if (workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD) {
|
||||
return setHistoryModalOpen(true);
|
||||
}
|
||||
return setOpenHistoryTipsModal(true);
|
||||
}, [setOpenHistoryTipsModal, workspace.flavour]);
|
||||
|
||||
const handleOpenTrashModal = useCallback(() => {
|
||||
if (!pageMeta) {
|
||||
@@ -186,8 +191,7 @@ export const PageHeaderMenuButton = ({
|
||||
</MenuItem>
|
||||
<Export exportHandler={exportHandler} pageMode={currentMode} />
|
||||
|
||||
{workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD &&
|
||||
runtimeConfig.enablePageHistory ? (
|
||||
{runtimeConfig.enablePageHistory ? (
|
||||
<MenuItem
|
||||
preFix={
|
||||
<MenuIcon>
|
||||
|
||||
@@ -72,17 +72,25 @@ const CloudQuotaModal = lazy(() =>
|
||||
default: module.CloudQuotaModal,
|
||||
}))
|
||||
);
|
||||
|
||||
const StarAFFiNEModal = lazy(() =>
|
||||
import('../components/affine/star-affine-modal').then(module => ({
|
||||
default: module.StarAFFiNEModal,
|
||||
}))
|
||||
);
|
||||
|
||||
const IssueFeedbackModal = lazy(() =>
|
||||
import('../components/affine/issue-feedback-modal').then(module => ({
|
||||
default: module.IssueFeedbackModal,
|
||||
}))
|
||||
);
|
||||
|
||||
const HistoryTipsModal = lazy(() =>
|
||||
import('../components/affine/history-tips-modal').then(module => ({
|
||||
default: module.HistoryTipsModal,
|
||||
}))
|
||||
);
|
||||
|
||||
export const Setting = () => {
|
||||
const [{ open, workspaceMetadata, activeTab }, setOpenSettingModalAtom] =
|
||||
useAtom(openSettingModalAtom);
|
||||
@@ -184,7 +192,10 @@ export function CurrentWorkspaceModals() {
|
||||
<WorkspaceGuideModal />
|
||||
{currentWorkspace ? <Setting /> : null}
|
||||
{currentWorkspace?.flavour === WorkspaceFlavour.LOCAL && (
|
||||
<LocalQuotaModal />
|
||||
<>
|
||||
<LocalQuotaModal />
|
||||
<HistoryTipsModal />
|
||||
</>
|
||||
)}
|
||||
{currentWorkspace?.flavour === WorkspaceFlavour.AFFINE_CLOUD && (
|
||||
<CloudQuotaModal />
|
||||
|
||||
Reference in new issue
Block a user