insomnia/app/ui/components/settings/SettingsSync.js

93 lines
2.8 KiB
JavaScript
Raw Normal View History

import React, {PropTypes} from 'react';
import Link from '../base/Link';
import PromptButton from '../base/PromptButton';
import {trackEvent} from '../../../analytics/index';
const SettingsSync = ({
loggedIn,
firstName,
handleExit,
handleUpdateSetting,
handleShowSignup,
handleCancelAccount,
handleLogout,
2016-11-11 01:36:23 +00:00
handleReset,
}) => (
<div className="pad">
<h1>Cloud Sync and Backup</h1>
{loggedIn ? [
<p key="1">
Hi {firstName}! Thanks for signing up for Insomnia
Plus.
</p>,
2016-11-11 01:36:23 +00:00
<p key="2" className="pad-top">
<PromptButton
className="btn btn--super-compact btn--outlined danger"
onClick={() => {
handleExit();
handleCancelAccount();
}}>
Cancel Subscription
</PromptButton>
{" "}
2016-11-11 01:36:23 +00:00
<PromptButton className="btn btn--super-compact btn--outlined warning"
onClick={handleReset}
confirmMessage="Delete all sync-related data?">
Reset Remote Data
</PromptButton>
{" "}
<PromptButton className="btn btn--super-compact btn--outlined"
onClick={async () => {
handleExit();
await handleLogout();
}}>
Log Out
</PromptButton>
</p>
] : [
<p key="0">
<Link href="https://insomnia.rest/plus/">Insomnia Plus</Link> helps you <i>rest</i> easy by
keeping your workspaces securely backed up and synced across all of your devices.
</p>,
<p key="1">
Upgrade today to start enjoying
{" "}
<Link href="https://insomnia.rest/pricing/">all of the benefits</Link>, while also helping
support my continuous effort of making Insomnia awesome! <i className="fa fa-smile-o txt-xl"/>
</p>,
<p key="2" className="pad-top text-center">
<button className="btn txt-lg btn--outlined"
onClick={() => {
handleExit();
trackEvent('Settings Sync', 'Click Upgrade');
handleShowSignup()
}}>
Upgrade to Plus
</button>
</p>,
<p key="3" className="text-center italic">
$5 per month or $50 per year
2016-11-17 18:45:54 +00:00
<br/>
<span className="txt-sm faint pad-top-sm">
2016-11-17 23:22:23 +00:00
14-day trial (cancel at any time)
2016-11-17 18:45:54 +00:00
</span>
</p>
]}
</div>
);
SettingsSync.propTypes = {
loggedIn: PropTypes.bool.isRequired,
firstName: PropTypes.string.isRequired,
handleExit: PropTypes.func.isRequired,
handleUpdateSetting: PropTypes.func.isRequired,
handleShowSignup: PropTypes.func.isRequired,
handleCancelAccount: PropTypes.func.isRequired,
handleLogout: PropTypes.func.isRequired,
2016-11-11 01:36:23 +00:00
handleReset: PropTypes.func.isRequired,
};
export default SettingsSync;