mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #35855 from overleaf/ds-unable-to-sync-modal-improved
[WEB] Adding improved version of the unable to sync modal GitOrigin-RevId: 1cfe2b3a2e8417028339efddb18385a5224e50c3
This commit is contained in:
@@ -30,8 +30,10 @@ type ModalsContextValue = {
|
||||
editorContent: OutOfSyncModalProps['editorContent']
|
||||
) => void
|
||||
showUnableToSyncModal: (
|
||||
editorContent: UnableToSyncModalProps['editorContent'],
|
||||
docName: UnableToSyncModalProps['docName']
|
||||
data: Pick<
|
||||
UnableToSyncModalProps,
|
||||
'baseContent' | 'targetContent' | 'docName' | 'rootFolderId'
|
||||
>
|
||||
) => void
|
||||
}
|
||||
|
||||
@@ -59,12 +61,16 @@ export const ModalsContextProvider: FC<React.PropsWithChildren> = ({
|
||||
|
||||
const [shouldShowUnableToSyncModal, setShouldShowUnableToSyncModal] =
|
||||
useState(false)
|
||||
const [unableToSyncModalData, setUnableToSyncModalData] = useState<{
|
||||
editorContent: string
|
||||
docName: string | null
|
||||
}>({
|
||||
editorContent: '',
|
||||
const [unableToSyncModalData, setUnableToSyncModalData] = useState<
|
||||
Pick<
|
||||
UnableToSyncModalProps,
|
||||
'baseContent' | 'targetContent' | 'docName' | 'rootFolderId'
|
||||
>
|
||||
>({
|
||||
baseContent: '',
|
||||
targetContent: '',
|
||||
docName: null,
|
||||
rootFolderId: undefined,
|
||||
})
|
||||
|
||||
const handleHideGenericModal = useCallback(() => {
|
||||
@@ -113,8 +119,13 @@ export const ModalsContextProvider: FC<React.PropsWithChildren> = ({
|
||||
}, [])
|
||||
|
||||
const showUnableToSyncModal = useCallback(
|
||||
(editorContent: string, docName: string | null) => {
|
||||
setUnableToSyncModalData({ editorContent, docName })
|
||||
(
|
||||
data: Pick<
|
||||
UnableToSyncModalProps,
|
||||
'baseContent' | 'targetContent' | 'docName' | 'rootFolderId'
|
||||
>
|
||||
) => {
|
||||
setUnableToSyncModalData(data)
|
||||
setShouldShowUnableToSyncModal(true)
|
||||
},
|
||||
[]
|
||||
|
||||
Reference in New Issue
Block a user