diff --git a/packages/fakeyou/src/App.tsx b/packages/fakeyou/src/App.tsx index fe632eb81a..b07eecb2cf 100644 --- a/packages/fakeyou/src/App.tsx +++ b/packages/fakeyou/src/App.tsx @@ -111,6 +111,8 @@ interface State { // Current text entered textBuffer: string; + + lightMode: boolean; } function newVocodes() { @@ -165,6 +167,8 @@ class App extends React.Component { w2lTemplateUploadJobs: [], textBuffer: "", + + lightMode: true }; } @@ -172,6 +176,16 @@ class App extends React.Component { // Handle redesign console.log('componentWillMount', 'useRefresh?', USE_REFRESH); + if (!window.localStorage.getItem('lightMode')) { + window.localStorage.setItem('lightMode', 'false') + } else { + const currentView = window.localStorage.getItem('lightMode') === 'true' ? true : false + + this.setState({ + lightMode: currentView + }) + } + if (USE_REFRESH) { // Redesign-specific CSS // NB(echelon): Despite the branches here, scss is all combined together at compile time @@ -188,6 +202,8 @@ class App extends React.Component { require("./AppOld.scss"); require("./v2/view/_css/footer.scss"); } + + // check to see if their is a cookie } async componentDidMount() { @@ -217,7 +233,7 @@ class App extends React.Component { const hasChineseSimplified = locale.language_codes.indexOf("zh") > -1; const hasFrench = locale.language_codes.indexOf("fr") > -1; const hasGerman = locale.language_codes.indexOf("de") > -1; - const hasHindi= locale.language_codes.indexOf("hi") > -1; + const hasHindi = locale.language_codes.indexOf("hi") > -1; const hasIndonesian = locale.language_codes.indexOf("id") > -1; const hasItalian = locale.language_codes.indexOf("it") > -1; const hasJapanese = locale.language_codes.indexOf("ja") > -1; @@ -272,16 +288,16 @@ class App extends React.Component { const showPleaseFollowNotice = hasSpanish || hasPortuguese; const showBootstrapLanguageNotice = ( - hasJapanese + hasJapanese || hasChineseSimplified - || hasFrench - || hasGerman - || hasHindi - || hasIndonesian - || hasItalian - || hasKorean - || hasTurkish - || hasVietnamese + || hasFrench + || hasGerman + || hasHindi + || hasIndonesian + || hasItalian + || hasKorean + || hasTurkish + || hasVietnamese ); this.setState({ @@ -578,27 +594,29 @@ class App extends React.Component { this.setState({ textBuffer: "" }); }; + + public render() { // Redesign features - let mainClassNames = USE_REFRESH ? "bg-gradient" : ""; - if (USE_REFRESH) { + let mainClassNames; - } + mainClassNames = USE_REFRESH ? "bg-gradient " : ""; + mainClassNames = mainClassNames + (this.state.lightMode ? ' light-mode' : '') return ( - -
-
-
-
-
-
-
-
-
-
+
+
+ +
+
+
+
+
+
+
+
@@ -610,7 +628,7 @@ class App extends React.Component { /> */} -
+
({ + const [pendingTtsJobs, setPendingTtsJobs] = useState({ success: true, pending_job_count: 0, cache_time: new Date(0), // NB: Epoch @@ -407,7 +407,7 @@ function NewTopNavFc(props: Props) {
  • Clone My Voice!