11import {
22 IconCalendar ,
3+ IconCircleX ,
34 IconCode ,
45 IconFiles ,
56 IconHelp ,
@@ -11,6 +12,8 @@ import * as React from 'react';
1112import { MODE , MODE_FEATURES } from '../shared/constants' ;
1213import { LANGUAGES } from '../shared/languages' ;
1314import '../shared/polyfill' ;
15+ import { Settings as SettingsT } from '../shared/settings' ;
16+ import { Button } from './components/Button' ;
1417import { ErrorBoundary } from './components/ErrorBoundary' ;
1518import { Loading } from './components/Loading' ;
1619import { Editor } from './Editor' ;
@@ -102,6 +105,37 @@ export function defaultRoutes(): Routes {
102105 ] . filter ( Boolean ) ;
103106}
104107
108+ function Aug2022Survey ( {
109+ settings,
110+ setSettings,
111+ } : {
112+ settings : SettingsT ;
113+ setSettings : ( s : Partial < SettingsT > ) => void ;
114+ } ) {
115+ if ( ! settings . surveyAug2022 ) {
116+ return null ;
117+ }
118+
119+ return (
120+ < div className = "banner vertical-align-center" >
121+ < Button
122+ icon
123+ onClick = { ( ) => setSettings ( { ...settings , surveyAug2022 : false } ) }
124+ >
125+ < IconCircleX />
126+ </ Button >
127+ Help us out: take a quick
128+ < a
129+ target = "_blank"
130+ href = "https://docs.google.com/forms/d/e/1FAIpQLSdNhU5k3FsIkcea_CTPVrmJ45k0czRz60XqLmBVUE5TjaT_jg/viewform"
131+ >
132+ user survey
133+ </ a >
134+ !
135+ </ div >
136+ ) ;
137+ }
138+
105139export function App < T extends DefaultView = DefaultView > ( {
106140 routes,
107141} : {
@@ -179,6 +213,7 @@ export function App<T extends DefaultView = DefaultView>({
179213 < SettingsContext . Provider
180214 value = { { state : settings , setState : setSettings } }
181215 >
216+ < Aug2022Survey settings = { settings } setSettings = { setSettings } />
182217 < div className = { `app app--${ MODE } app--${ settings . theme } ` } >
183218 { MODE_FEATURES . appHeader && ! isMakeSelect && < Header /> }
184219 < main className = { 'view view-' + ( urlState . view || 'editor' ) } >
0 commit comments