import React from 'react'; import {AccountStore} from 'nylas-exports'; import {RetinaImg} from 'nylas-component-kit'; import OnboardingActions from './onboarding-actions'; const PageTopBar = (props) => { const {pageDepth} = props; const closeClass = (pageDepth > 1) ? 'back' : 'close'; const closeIcon = (pageDepth > 1) ? 'onboarding-back.png' : 'onboarding-close.png'; const closeAction = () => { const webview = document.querySelector('webview'); if (webview && webview.canGoBack()) { webview.goBack(); } else if (pageDepth > 1) { OnboardingActions.moveToPreviousPage(); } else { if (AccountStore.accounts().length === 0) { NylasEnv.quit(); } else { NylasEnv.close(); } } } return (