File tree 2 files changed +12
-5
lines changed
homepage/src/components/Toast 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 1
- import { convertTypeToStatus } from '@codesandbox/common/lib/utils /notifications' ;
1
+ import { NotificationStatus } from '@codesandbox/notifications' ;
2
2
import { OnInitialize } from '.' ;
3
3
4
4
export const onInitialize : OnInitialize = async (
@@ -109,12 +109,13 @@ export const onInitialize: OnInitialize = async (
109
109
110
110
// show terms message on first visit since new terms
111
111
if ( ! effects . browser . storage . get ( seenTermsKey ) && ! state . isFirstVisit ) {
112
+ effects . analytics . track ( 'Saw Privacy Policy Notification' ) ;
112
113
effects . notificationToast . add ( {
113
114
message :
114
115
'Hello, our privacy policy has been updated recently. What’s new? CodeSandbox emails. Please read and reach out.' ,
115
116
title : 'Updated Privacy' ,
116
- status : convertTypeToStatus ( 'notice' ) ,
117
- sticky : true ,
117
+ status : NotificationStatus . NOTICE ,
118
+ timeAlive : 20_000 ,
118
119
actions : {
119
120
primary : [
120
121
{
Original file line number Diff line number Diff line change 1
1
/* eslint-disable jsx-a11y/control-has-associated-label */
2
2
import React , { useState , useEffect } from 'react' ;
3
+ import track from '@codesandbox/common/lib/utils/analytics' ;
3
4
import { Link } from 'gatsby' ;
4
5
import { AnimatePresence } from 'framer-motion' ;
5
6
@@ -10,8 +11,13 @@ const Privacy = () => {
10
11
const [ show , setShow ] = useState ( false ) ;
11
12
12
13
useEffect ( ( ) => {
13
- setShow ( ! window . localStorage . getItem ( key ) ) ;
14
- window . localStorage . setItem ( key , true ) ;
14
+ const hasSeen = ! ! window . localStorage . getItem ( key ) ;
15
+ if ( ! hasSeen ) {
16
+ setShow ( true ) ;
17
+ window . localStorage . setItem ( key , true ) ;
18
+
19
+ track ( 'Saw Privacy Policy Notification' ) ;
20
+ }
15
21
} , [ ] ) ;
16
22
17
23
return (
You can’t perform that action at this time.
0 commit comments