remove play store button

This commit is contained in:
adueck 2023-06-27 11:34:57 +04:00
parent f9162333d3
commit ab0916aadd
4 changed files with 0 additions and 38 deletions

View File

@ -125,7 +125,6 @@ class App extends Component<RouteComponentProps, State> {
wordlistReviewLanguage: "Pashto",
wordlistReviewBadge: true,
searchBarPosition: "top",
showPlayStoreButton: false,
},
searchValue: "",
page: 1,
@ -147,24 +146,9 @@ class App extends Component<RouteComponentProps, State> {
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<RouteComponentProps, State> {
});
}
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<RouteComponentProps, State> {
Grammar
</a>
</div>
{this.state.options.showPlayStoreButton && <div className="mt-4" onClick={this.handlePlayStoreClick}>
<a href='https://play.google.com/store/apps/details?id=com.lingdocs.pashto.dictionary&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'>
<img style={{ maxWidth: "8rem" }} alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png'/>
</a>
</div>}
</div>
</Route>
<Route path="/about">

View File

@ -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);

View File

@ -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");
}

View File

@ -65,7 +65,6 @@ export type Options = {
wordlistReviewBadge: boolean,
searchBarPosition: SearchBarPosition,
searchBarStickyFocus: boolean,
showPlayStoreButton: boolean,
}
export type Language = "Pashto" | "English";