mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
* feat: integrate main layout, toolbar, and rail from redesign into main ide-react folder * feat: remove additional files no longer used after ide redesign GitOrigin-RevId: 8fd77f63cb9c67be91995a9dde13b0fe2376d80f
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import ShareProjectModal from '@/features/share-project-modal/components/share-project-modal'
|
|
import OLButton from '@/shared/components/ol/ol-button'
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
import { useCallback, useState } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { useEditorAnalytics } from '@/shared/hooks/use-editor-analytics'
|
|
|
|
export default function ShareProjectButton() {
|
|
const { t } = useTranslation()
|
|
const { sendEventOnce } = useEditorAnalytics()
|
|
|
|
const [showShareModal, setShowShareModal] = useState(false)
|
|
|
|
const handleOpenShareModal = useCallback(() => {
|
|
sendEventOnce('ide-open-share-modal-once')
|
|
setShowShareModal(true)
|
|
}, [sendEventOnce])
|
|
|
|
const handleHideShareModal = useCallback(() => {
|
|
setShowShareModal(false)
|
|
}, [])
|
|
|
|
return (
|
|
<>
|
|
<div className="ide-redesign-toolbar-button-container">
|
|
<OLButton
|
|
size="sm"
|
|
variant="primary"
|
|
leadingIcon={<MaterialIcon type="person_add" />}
|
|
onClick={handleOpenShareModal}
|
|
>
|
|
{t('share')}
|
|
</OLButton>
|
|
</div>
|
|
<ShareProjectModal
|
|
show={showShareModal}
|
|
handleOpen={handleOpenShareModal}
|
|
handleHide={handleHideShareModal}
|
|
/>
|
|
</>
|
|
)
|
|
}
|