mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #31035 from overleaf/mg-context-menu-analytics
Add analytics event for context menu, comment, track changes, and jump to location GitOrigin-RevId: 8412cc3c8039cd1582ccee20b162b4bef4467dea
This commit is contained in:
@@ -20,6 +20,11 @@ import { WritefullAPI } from './types/writefull-instance'
|
||||
import { Cobranding } from '../../../../types/cobranding'
|
||||
import { SymbolWithCharacter } from '../../../../modules/symbol-palette/frontend/js/data/symbols'
|
||||
|
||||
type UpgradeTrackChangesModal = {
|
||||
show: boolean
|
||||
location?: string
|
||||
}
|
||||
|
||||
export const EditorContext = createContext<
|
||||
| {
|
||||
cobranding?: Cobranding
|
||||
@@ -35,8 +40,10 @@ export const EditorContext = createContext<
|
||||
premiumSuggestionResetDate: Date
|
||||
writefullInstance: WritefullAPI | null
|
||||
setWritefullInstance: (instance: WritefullAPI) => void
|
||||
showUpgradeModal: boolean
|
||||
setShowUpgradeModal: Dispatch<SetStateAction<boolean>>
|
||||
upgradeTrackChangesModal: UpgradeTrackChangesModal
|
||||
setUpgradeTrackChangesModal: Dispatch<
|
||||
SetStateAction<UpgradeTrackChangesModal>
|
||||
>
|
||||
}
|
||||
| undefined
|
||||
>(undefined)
|
||||
@@ -88,7 +95,8 @@ export const EditorProvider: FC<React.PropsWithChildren> = ({ children }) => {
|
||||
: new Date()
|
||||
})
|
||||
|
||||
const [showUpgradeModal, setShowUpgradeModal] = useState(false)
|
||||
const [showUpgradeModal, setShowUpgradeModal] =
|
||||
useState<UpgradeTrackChangesModal>({ show: false })
|
||||
|
||||
const isPendingEditor = useMemo(
|
||||
() =>
|
||||
@@ -170,8 +178,8 @@ export const EditorProvider: FC<React.PropsWithChildren> = ({ children }) => {
|
||||
setPremiumSuggestionResetDate,
|
||||
writefullInstance,
|
||||
setWritefullInstance,
|
||||
showUpgradeModal,
|
||||
setShowUpgradeModal,
|
||||
upgradeTrackChangesModal: showUpgradeModal,
|
||||
setUpgradeTrackChangesModal: setShowUpgradeModal,
|
||||
}),
|
||||
[
|
||||
cobranding,
|
||||
|
||||
Reference in New Issue
Block a user