@bufferapp/upgrade-to-pro
Advanced tools
Comparing version 1.56.0 to 1.74.1
@@ -66,3 +66,3 @@ import React from 'react'; | ||
<Locked size="extraLarge" /> | ||
<Button label="Unlock with Analyze Premium" onClick={this.showModal.bind(this)} /> | ||
<Button label="Upgrade to Unlock" onClick={this.showModal.bind(this)} /> | ||
</LockContent> | ||
@@ -69,0 +69,0 @@ {children} |
@@ -1,11 +0,7 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import React, { useContext } from 'react'; | ||
import styled from 'styled-components'; | ||
import Button from '@bufferapp/ui/Button'; | ||
import Modal from '@bufferapp/ui/Modal'; | ||
import Text from '@bufferapp/ui/Text'; | ||
import { ModalContext, MODALS, useUser } from '@bufferapp/app-shell'; | ||
const ModalWrapper = styled.section` | ||
`; | ||
const Wrapper = styled.section` | ||
@@ -21,53 +17,38 @@ width: 100%; | ||
class UpgradeToPro extends React.Component { | ||
state = { | ||
open: false, | ||
} | ||
function UpgradeToPro({ | ||
hide, | ||
title, | ||
description, | ||
}) { | ||
const user = useUser(); | ||
const context = useContext(ModalContext); | ||
showModal() { | ||
this.setState({ | ||
open: true, | ||
}); | ||
} | ||
hideModal() { | ||
this.setState({ | ||
open: false, | ||
}); | ||
} | ||
render() { | ||
return ( | ||
<ModalWrapper> | ||
<Modal | ||
secondaryAction={{ | ||
label: 'Dismiss', | ||
callback: this.props.hide, | ||
}} | ||
action={{ | ||
label: 'Upgrade to Analyze Premium today', | ||
callback: () => window.location = 'https://account.buffer.com/analyze?upgradeToPremium=true', | ||
}} | ||
> | ||
<Wrapper> | ||
<Text type="h2">{this.props.title}</Text> | ||
<Text type="p">{this.props.description}</Text> | ||
</Wrapper> | ||
</Modal> | ||
</ModalWrapper> | ||
); | ||
return ( | ||
<Modal | ||
secondaryAction={{ | ||
label: 'Dismiss', | ||
callback: hide, | ||
}} | ||
action={{ | ||
label: 'Upgrade now', | ||
callback: () => { | ||
if (user && | ||
user.currentOrganization && | ||
user.currentOrganization.isOneBufferOrganization | ||
) { | ||
hide() | ||
context.openModal(MODALS.planSelector, { isUpgradeIntent: true }) | ||
} else { | ||
window.location = 'https://account.buffer.com/analyze?upgradeToPremium=true' | ||
} | ||
}, | ||
}} | ||
> | ||
<Wrapper> | ||
<Text type="h2">{title}</Text> | ||
<Text type="p">{description}</Text> | ||
</Wrapper> | ||
</Modal>); | ||
} | ||
} | ||
UpgradeToPro.defaultProps = { | ||
type: null, | ||
}; | ||
UpgradeToPro.propTypes = { | ||
label: PropTypes.string.isRequired, | ||
upgradeToPro: PropTypes.func.isRequired, | ||
type: PropTypes.string, | ||
}; | ||
export default UpgradeToPro; |
{ | ||
"name": "@bufferapp/upgrade-to-pro", | ||
"version": "1.56.0", | ||
"version": "1.74.1", | ||
"description": "Upgrade to Pro components", | ||
@@ -19,3 +19,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "cc22a98fe20db394dc94c4d849391971fab903f3" | ||
"gitHead": "b4c7c64f1287f4b33ecc792471af2d2f4978d595" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
10823
14
246
2