11import { notify , Skeleton } from '@affine/component' ;
2- import { PublicLinkDisableModal } from '@affine/component/disable-public-link' ;
32import { Button } from '@affine/component/ui/button' ;
43import { Menu , MenuItem , MenuTrigger } from '@affine/component/ui/menu' ;
54import { openSettingModalAtom } from '@affine/core/atoms' ;
@@ -14,10 +13,10 @@ import { WorkspaceFlavour } from '@affine/env/workspace';
1413import { PublicPageMode } from '@affine/graphql' ;
1514import { useI18n } from '@affine/i18n' ;
1615import {
16+ BlockIcon ,
1717 CollaborationIcon ,
1818 DoneIcon ,
1919 EdgelessIcon ,
20- LinkIcon ,
2120 LockIcon ,
2221 PageIcon ,
2322 SingleSelectSelectSolidIcon ,
@@ -26,7 +25,7 @@ import {
2625import { useLiveData , useService } from '@toeverything/infra' ;
2726import { cssVar } from '@toeverything/theme' ;
2827import { useSetAtom } from 'jotai' ;
29- import { Suspense , useCallback , useEffect , useState } from 'react' ;
28+ import { Suspense , useCallback , useEffect } from 'react' ;
3029import { ErrorBoundary } from 'react-error-boundary' ;
3130
3231import { CloudSvg } from '../cloud-svg' ;
@@ -75,9 +74,6 @@ export const AFFiNESharePage = (props: ShareMenuProps) => {
7574 const baseUrl = useLiveData ( serverConfig . config$ . map ( c => c ?. baseUrl ) ) ;
7675 const isLoading =
7776 isSharedPage === null || sharedMode === null || baseUrl === null ;
78- const [ showDisable , setShowDisable ] = useState ( false ) ;
79-
80- const currentDocMode = useLiveData ( editor . mode$ ) ;
8177
8278 const permissionService = useService ( WorkspacePermissionService ) ;
8379 const isOwner = useLiveData ( permissionService . permission . isOwner$ ) ;
@@ -152,15 +148,8 @@ export const AFFiNESharePage = (props: ShareMenuProps) => {
152148 } ) ;
153149 console . log ( err ) ;
154150 }
155- setShowDisable ( false ) ;
156151 } , [ shareInfoService , t ] ) ;
157152
158- const onClickDisable = useCallback ( ( ) => {
159- if ( isSharedPage ) {
160- setShowDisable ( true ) ;
161- }
162- } , [ isSharedPage ] ) ;
163-
164153 const isMac = environment . isBrowser && environment . isMacOs ;
165154
166155 const { onClickCopyLink } = useSharingUrl ( {
@@ -207,7 +196,7 @@ export const AFFiNESharePage = (props: ShareMenuProps) => {
207196 } }
208197 items = {
209198 < >
210- < MenuItem prefixIcon = { < LockIcon /> } onSelect = { onClickDisable } >
199+ < MenuItem prefixIcon = { < LockIcon /> } onSelect = { onDisablePublic } >
211200 < div className = { styles . publicItemRowStyle } >
212201 < div >
213202 { t [ 'com.affine.share-menu.option.link.no-access' ] ( ) }
@@ -248,20 +237,9 @@ export const AFFiNESharePage = (props: ShareMenuProps) => {
248237 < div className = { styles . labelStyle } >
249238 { t [ 'com.affine.share-menu.option.permission.label' ] ( ) }
250239 </ div >
251- < Menu
252- contentOptions = { {
253- align : 'end' ,
254- } }
255- items = {
256- < MenuItem >
257- { t [ 'com.affine.share-menu.option.permission.can-edit' ] ( ) }
258- </ MenuItem >
259- }
260- >
261- < MenuTrigger className = { styles . menuTriggerStyle } disabled >
262- { t [ 'com.affine.share-menu.option.permission.can-edit' ] ( ) }
263- </ MenuTrigger >
264- </ Menu >
240+ < Button className = { styles . menuTriggerStyle } disabled >
241+ { t [ 'com.affine.share-menu.option.permission.can-edit' ] ( ) }
242+ </ Button >
265243 </ div >
266244 </ div >
267245 { isOwner && (
@@ -307,14 +285,9 @@ export const AFFiNESharePage = (props: ShareMenuProps) => {
307285 >
308286 { t [ 'com.affine.share-menu.copy.edgeless' ] ( ) }
309287 </ MenuItem >
310- < MenuItem prefixIcon = { < LinkIcon /> } onSelect = { onCopyBlockLink } >
288+ < MenuItem prefixIcon = { < BlockIcon /> } onSelect = { onCopyBlockLink } >
311289 { t [ 'com.affine.share-menu.copy.block' ] ( ) }
312290 </ MenuItem >
313- { currentDocMode === 'edgeless' && (
314- < MenuItem prefixIcon = { < LinkIcon /> } onSelect = { onCopyBlockLink } >
315- { t [ 'com.affine.share-menu.copy.frame' ] ( ) }
316- </ MenuItem >
317- ) }
318291 </ >
319292 }
320293 >
@@ -327,12 +300,6 @@ export const AFFiNESharePage = (props: ShareMenuProps) => {
327300 />
328301 </ Menu >
329302 </ div >
330-
331- < PublicLinkDisableModal
332- open = { showDisable }
333- onConfirm = { onDisablePublic }
334- onOpenChange = { setShowDisable }
335- />
336303 </ div >
337304 ) ;
338305} ;
0 commit comments