From a52eb813809448db4957cec5c78317419c98ddba Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 3 Jul 2018 12:48:19 -0700 Subject: Rename isMobile utility fn to be more specific and add isMobileOperatingSystem --- .../website/ts/components/onboarding/portal_onboarding_flow.tsx | 2 +- packages/website/ts/components/portal/portal.tsx | 6 +++--- packages/website/ts/utils/utils.ts | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx index 6bfa5c75f..d0955c2dc 100644 --- a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx +++ b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx @@ -267,7 +267,7 @@ class PlainPortalOnboardingFlow extends React.Component { ); } private _renderWallet(): React.ReactNode { - const isMobile = utils.isMobile(this.props.screenWidth); + const isMobile = utils.isMobileWidth(this.props.screenWidth); // We need room to scroll down for mobile onboarding const marginBottom = isMobile ? '200px' : '15px'; return ( @@ -364,7 +364,7 @@ export class Portal extends React.Component { ); } private _renderStartOnboarding(): React.ReactNode { - const isMobile = utils.isMobile(this.props.screenWidth); + const isMobile = utils.isMobileWidth(this.props.screenWidth); const shouldStartOnboarding = !isMobile || this.props.location.pathname === `${WebsitePaths.Portal}/account`; const startOnboarding = ( @@ -530,7 +530,7 @@ export class Portal extends React.Component { return
} body={this._renderRelayerIndex()} />; } private _renderRelayerIndex(): React.ReactNode { - const isMobile = utils.isMobile(this.props.screenWidth); + const isMobile = utils.isMobileWidth(this.props.screenWidth); return ( {isMobile && {this._renderStartOnboarding()}} diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index e0f9d8e42..ffbf97f12 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -405,9 +405,12 @@ export const utils = { openUrl(url: string): void { window.open(url, '_blank'); }, - isMobile(screenWidth: ScreenWidths): boolean { + isMobileWidth(screenWidth: ScreenWidths): boolean { return screenWidth === ScreenWidths.Sm; }, + isMobileOperatingSystem(): boolean { + return bowser.mobile; + }, getBrowserType(): BrowserType { if (bowser.chrome) { return BrowserType.Chrome; -- cgit v1.2.3