From 139853a491c30dd2190d1e23950fc3b308d4bc11 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Tue, 8 Feb 2022 20:25:12 +0530 Subject: [PATCH] feat: show all themes and premium icon if not entitled (#854) --- .../components/ApplicationView.tsx | 105 +++--- .../javascripts/components/Navigation.tsx | 63 ++-- .../NotesOptions/ChangeEditorOption.tsx | 19 +- .../QuickSettingsMenu/FocusModeSwitch.tsx | 15 +- .../QuickSettingsMenu/QuickSettingsMenu.tsx | 155 +++++---- .../QuickSettingsMenu/ThemesMenuButton.tsx | 76 +++-- .../preferences/panes/Appearance.tsx | 312 +++++++++--------- 7 files changed, 405 insertions(+), 340 deletions(-) diff --git a/app/assets/javascripts/components/ApplicationView.tsx b/app/assets/javascripts/components/ApplicationView.tsx index 74fa60157..95c955501 100644 --- a/app/assets/javascripts/components/ApplicationView.tsx +++ b/app/assets/javascripts/components/ApplicationView.tsx @@ -23,6 +23,7 @@ import { NotesContextMenu } from '@/components/NotesContextMenu'; import { PurchaseFlowWrapper } from '@/purchaseFlow/PurchaseFlowWrapper'; import { render } from 'preact'; import { PermissionsModal } from './PermissionsModal'; +import { PremiumModalProvider } from './Premium'; type Props = { application: WebApplication; @@ -196,63 +197,65 @@ export class ApplicationView extends PureComponent { render() { return ( -
- {!this.state.needsUnlock && this.state.launched && ( -
- + +
+ {!this.state.needsUnlock && this.state.launched && ( +
+ - - - -
- )} - - {!this.state.needsUnlock && this.state.launched && ( -
- )} - - - - - - {this.state.challenges.map((challenge) => { - return ( -
- + +
- ); - })} + )} - + {!this.state.needsUnlock && this.state.launched && ( +
+ )} - -
+ + + + + {this.state.challenges.map((challenge) => { + return ( +
+ +
+ ); + })} + + + + +
+ ); } } diff --git a/app/assets/javascripts/components/Navigation.tsx b/app/assets/javascripts/components/Navigation.tsx index c97c790cc..71f0e29f1 100644 --- a/app/assets/javascripts/components/Navigation.tsx +++ b/app/assets/javascripts/components/Navigation.tsx @@ -6,7 +6,6 @@ import { ApplicationEvent, PrefKey } from '@standardnotes/snjs'; import { observer } from 'mobx-react-lite'; import { FunctionComponent } from 'preact'; import { useCallback, useEffect, useMemo, useState } from 'preact/hooks'; -import { PremiumModalProvider } from './Premium'; import { PanelSide, ResizeFinishCallback, @@ -51,42 +50,40 @@ export const Navigation: FunctionComponent = observer( }, [appState]); return ( - -