|
@@ -8,6 +8,7 @@ import { postJSON } from '@/infrastructure/fetch-json'
|
|
|
import { debugConsole } from '@/utils/debugging'
|
|
import { debugConsole } from '@/utils/debugging'
|
|
|
import useAsync from '@/shared/hooks/use-async'
|
|
import useAsync from '@/shared/hooks/use-async'
|
|
|
import Notification from '@/shared/components/notification'
|
|
import Notification from '@/shared/components/notification'
|
|
|
|
|
+import { sendMB } from '@/infrastructure/event-tracking'
|
|
|
|
|
|
|
|
function SharingUpdatesRoot() {
|
|
function SharingUpdatesRoot() {
|
|
|
const { isReady } = useWaitForI18n()
|
|
const { isReady } = useWaitForI18n()
|
|
@@ -16,6 +17,10 @@ function SharingUpdatesRoot() {
|
|
|
const projectId = getMeta('ol-project_id')
|
|
const projectId = getMeta('ol-project_id')
|
|
|
|
|
|
|
|
const joinProject = useCallback(() => {
|
|
const joinProject = useCallback(() => {
|
|
|
|
|
+ sendMB('notification-click', {
|
|
|
|
|
+ name: 'link-sharing-collaborator',
|
|
|
|
|
+ button: 'ok',
|
|
|
|
|
+ })
|
|
|
runAsync(postJSON(`/project/${projectId}/sharing-updates/join`))
|
|
runAsync(postJSON(`/project/${projectId}/sharing-updates/join`))
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
location.assign(`/project/${projectId}`)
|
|
location.assign(`/project/${projectId}`)
|
|
@@ -24,6 +29,10 @@ function SharingUpdatesRoot() {
|
|
|
}, [runAsync, projectId])
|
|
}, [runAsync, projectId])
|
|
|
|
|
|
|
|
const viewProject = useCallback(() => {
|
|
const viewProject = useCallback(() => {
|
|
|
|
|
+ sendMB('notification-click', {
|
|
|
|
|
+ name: 'link-sharing-collaborator',
|
|
|
|
|
+ button: 'anonymous',
|
|
|
|
|
+ })
|
|
|
runAsync(postJSON(`/project/${projectId}/sharing-updates/view`))
|
|
runAsync(postJSON(`/project/${projectId}/sharing-updates/view`))
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
location.assign(`/project/${projectId}`)
|
|
location.assign(`/project/${projectId}`)
|
|
@@ -32,6 +41,10 @@ function SharingUpdatesRoot() {
|
|
|
}, [runAsync, projectId])
|
|
}, [runAsync, projectId])
|
|
|
|
|
|
|
|
const leaveProject = useCallback(() => {
|
|
const leaveProject = useCallback(() => {
|
|
|
|
|
+ sendMB('notification-click', {
|
|
|
|
|
+ name: 'link-sharing-collaborator',
|
|
|
|
|
+ button: 'leave',
|
|
|
|
|
+ })
|
|
|
runAsync(postJSON(`/project/${projectId}/leave`))
|
|
runAsync(postJSON(`/project/${projectId}/leave`))
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
location.assign('/project')
|
|
location.assign('/project')
|
|
@@ -67,6 +80,12 @@ function SharingUpdatesRoot() {
|
|
|
href="/blog/changes-to-project-sharing"
|
|
href="/blog/changes-to-project-sharing"
|
|
|
rel="noopener noreferrer"
|
|
rel="noopener noreferrer"
|
|
|
target="_blank"
|
|
target="_blank"
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ sendMB('notification-click', {
|
|
|
|
|
+ name: 'link-sharing-collaborator',
|
|
|
|
|
+ button: 'learn',
|
|
|
|
|
+ })
|
|
|
|
|
+ }}
|
|
|
/>,
|
|
/>,
|
|
|
]}
|
|
]}
|
|
|
/>
|
|
/>
|