remove play store button
This commit is contained in:
parent
f9162333d3
commit
ab0916aadd
|
@ -125,7 +125,6 @@ class App extends Component<RouteComponentProps, State> {
|
||||||
wordlistReviewLanguage: "Pashto",
|
wordlistReviewLanguage: "Pashto",
|
||||||
wordlistReviewBadge: true,
|
wordlistReviewBadge: true,
|
||||||
searchBarPosition: "top",
|
searchBarPosition: "top",
|
||||||
showPlayStoreButton: false,
|
|
||||||
},
|
},
|
||||||
searchValue: "",
|
searchValue: "",
|
||||||
page: 1,
|
page: 1,
|
||||||
|
@ -147,24 +146,9 @@ class App extends Component<RouteComponentProps, State> {
|
||||||
this.handleRefreshReviewTasks = this.handleRefreshReviewTasks.bind(this);
|
this.handleRefreshReviewTasks = this.handleRefreshReviewTasks.bind(this);
|
||||||
this.handleDictionaryUpdate = this.handleDictionaryUpdate.bind(this);
|
this.handleDictionaryUpdate = this.handleDictionaryUpdate.bind(this);
|
||||||
this.handleInflectionSearch = this.handleInflectionSearch.bind(this);
|
this.handleInflectionSearch = this.handleInflectionSearch.bind(this);
|
||||||
this.handlePlayStoreClick = this.handlePlayStoreClick.bind(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentDidMount() {
|
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);
|
window.addEventListener("scroll", this.handleScroll);
|
||||||
if (!possibleLandingPages.includes(this.props.location.pathname)) {
|
if (!possibleLandingPages.includes(this.props.location.pathname)) {
|
||||||
this.props.history.replace("/");
|
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) {
|
private handleOptionsUpdate(action: OptionsAction) {
|
||||||
if (action.type === "changeTheme") {
|
if (action.type === "changeTheme") {
|
||||||
document.documentElement.setAttribute("data-theme", action.payload);
|
document.documentElement.setAttribute("data-theme", action.payload);
|
||||||
|
@ -593,11 +570,6 @@ class App extends Component<RouteComponentProps, State> {
|
||||||
Grammar
|
Grammar
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/about">
|
<Route path="/about">
|
||||||
|
|
|
@ -27,9 +27,6 @@ export const readOptions = (): undefined | Options => {
|
||||||
// compatibility with legacy options
|
// compatibility with legacy options
|
||||||
options.searchBarStickyFocus = false;
|
options.searchBarStickyFocus = false;
|
||||||
}
|
}
|
||||||
if (!("showPlayStoreButton" in options)) {
|
|
||||||
options.showPlayStoreButton = false;
|
|
||||||
}
|
|
||||||
return options;
|
return options;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("error parsing saved state JSON", e);
|
console.error("error parsing saved state JSON", e);
|
||||||
|
|
|
@ -60,12 +60,6 @@ export function optionsReducer(options: Options, action: OptionsAction): Options
|
||||||
searchBarStickyFocus: action.payload,
|
searchBarStickyFocus: action.payload,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (action.type === "setShowPlayStoreButton") {
|
|
||||||
return {
|
|
||||||
...options,
|
|
||||||
showPlayStoreButton: action.payload,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw new Error("action type not recognized in options reducer");
|
throw new Error("action type not recognized in options reducer");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,6 @@ export type Options = {
|
||||||
wordlistReviewBadge: boolean,
|
wordlistReviewBadge: boolean,
|
||||||
searchBarPosition: SearchBarPosition,
|
searchBarPosition: SearchBarPosition,
|
||||||
searchBarStickyFocus: boolean,
|
searchBarStickyFocus: boolean,
|
||||||
showPlayStoreButton: boolean,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Language = "Pashto" | "English";
|
export type Language = "Pashto" | "English";
|
||||||
|
|
Loading…
Reference in New Issue