File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
homepage/src/components/Toast Expand file tree Collapse file tree 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' ;
22import { OnInitialize } from '.' ;
33
44export const onInitialize : OnInitialize = async (
@@ -109,12 +109,13 @@ export const onInitialize: OnInitialize = async (
109109
110110 // show terms message on first visit since new terms
111111 if ( ! effects . browser . storage . get ( seenTermsKey ) && ! state . isFirstVisit ) {
112+ effects . analytics . track ( 'Saw Privacy Policy Notification' ) ;
112113 effects . notificationToast . add ( {
113114 message :
114115 'Hello, our privacy policy has been updated recently. What’s new? CodeSandbox emails. Please read and reach out.' ,
115116 title : 'Updated Privacy' ,
116- status : convertTypeToStatus ( 'notice' ) ,
117- sticky : true ,
117+ status : NotificationStatus . NOTICE ,
118+ timeAlive : 20_000 ,
118119 actions : {
119120 primary : [
120121 {
Original file line number Diff line number Diff line change 11/* eslint-disable jsx-a11y/control-has-associated-label */
22import React , { useState , useEffect } from 'react' ;
3+ import track from '@codesandbox/common/lib/utils/analytics' ;
34import { Link } from 'gatsby' ;
45import { AnimatePresence } from 'framer-motion' ;
56
@@ -10,8 +11,13 @@ const Privacy = () => {
1011 const [ show , setShow ] = useState ( false ) ;
1112
1213 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+ }
1521 } , [ ] ) ;
1622
1723 return (
You can’t perform that action at this time.
0 commit comments