From ab0916aadd8488968d1f81d881f507336b5311f7 Mon Sep 17 00:00:00 2001 From: adueck Date: Tue, 27 Jun 2023 11:34:57 +0400 Subject: [PATCH] remove play store button --- website/src/App.tsx | 28 --------------------------- website/src/lib/local-storage.ts | 3 --- website/src/lib/options-reducer.ts | 6 ------ website/src/types/dictionary-types.ts | 1 - 4 files changed, 38 deletions(-) diff --git a/website/src/App.tsx b/website/src/App.tsx index e36485f..a1b9675 100644 --- a/website/src/App.tsx +++ b/website/src/App.tsx @@ -125,7 +125,6 @@ class App extends Component { wordlistReviewLanguage: "Pashto", wordlistReviewBadge: true, searchBarPosition: "top", - showPlayStoreButton: false, }, searchValue: "", page: 1, @@ -147,24 +146,9 @@ class App extends Component { this.handleRefreshReviewTasks = this.handleRefreshReviewTasks.bind(this); this.handleDictionaryUpdate = this.handleDictionaryUpdate.bind(this); this.handleInflectionSearch = this.handleInflectionSearch.bind(this); - this.handlePlayStoreClick = this.handlePlayStoreClick.bind(this); } public componentDidMount() { - window.addEventListener('DOMContentLoaded', () => { - let displayMode = 'browser tab'; - if (window.matchMedia('(display-mode: standalone)').matches) { - displayMode = 'standalone'; - } - const userAgent = navigator.userAgent.toLowerCase(); - const isAndroid = userAgent.indexOf("android") > -1; - if (isAndroid && displayMode !== "standalone") { - saveOptions(optionsReducer(this.state.options, { - type: "setShowPlayStoreButton", - payload: true, - })); - } - }); window.addEventListener("scroll", this.handleScroll); if (!possibleLandingPages.includes(this.props.location.pathname)) { this.props.history.replace("/"); @@ -403,13 +387,6 @@ class App extends Component { }); } - private handlePlayStoreClick() { - saveOptions(optionsReducer(this.state.options, { - type: "setShowPlayStoreButton", - payload: false, - })); - } - private handleOptionsUpdate(action: OptionsAction) { if (action.type === "changeTheme") { document.documentElement.setAttribute("data-theme", action.payload); @@ -593,11 +570,6 @@ class App extends Component { Grammar - {this.state.options.showPlayStoreButton &&
- - Get it on Google Play - -
} diff --git a/website/src/lib/local-storage.ts b/website/src/lib/local-storage.ts index 2c88c01..a99be9e 100644 --- a/website/src/lib/local-storage.ts +++ b/website/src/lib/local-storage.ts @@ -27,9 +27,6 @@ export const readOptions = (): undefined | Options => { // compatibility with legacy options options.searchBarStickyFocus = false; } - if (!("showPlayStoreButton" in options)) { - options.showPlayStoreButton = false; - } return options; } catch (e) { console.error("error parsing saved state JSON", e); diff --git a/website/src/lib/options-reducer.ts b/website/src/lib/options-reducer.ts index 18088a4..8e01f1c 100644 --- a/website/src/lib/options-reducer.ts +++ b/website/src/lib/options-reducer.ts @@ -60,12 +60,6 @@ export function optionsReducer(options: Options, action: OptionsAction): Options searchBarStickyFocus: action.payload, } } - if (action.type === "setShowPlayStoreButton") { - return { - ...options, - showPlayStoreButton: action.payload, - } - } throw new Error("action type not recognized in options reducer"); } diff --git a/website/src/types/dictionary-types.ts b/website/src/types/dictionary-types.ts index f9ff202..81ffcbc 100644 --- a/website/src/types/dictionary-types.ts +++ b/website/src/types/dictionary-types.ts @@ -65,7 +65,6 @@ export type Options = { wordlistReviewBadge: boolean, searchBarPosition: SearchBarPosition, searchBarStickyFocus: boolean, - showPlayStoreButton: boolean, } export type Language = "Pashto" | "English";