Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add MaxAccountByKonnectorPaywall
- Loading branch information
Showing
6 changed files
with
90 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
import Paywall from './Paywall' | ||
import { useI18n } from '../I18n' | ||
import withPaywallLocales from './locales/withPaywallLocales' | ||
|
||
/** | ||
* Paywall displayed when the user reach the maximum accounts allowed for a konnector | ||
*/ | ||
const MaxAccountsByKonnectorPaywall = ({ max, konnectorName, onClose }) => { | ||
const { t } = useI18n() | ||
|
||
return ( | ||
<Paywall | ||
variant="maxAccountsByKonnector" | ||
contentInterpolation={{ | ||
maxAccount: t('maxAccount', { smart_count: max }), | ||
konnectorName | ||
}} | ||
onClose={onClose} | ||
/> | ||
) | ||
} | ||
|
||
MaxAccountsByKonnectorPaywall.propTypes = { | ||
/** Maximum accounts allowed for the konnector */ | ||
max: PropTypes.number.isRequired, | ||
/** Name of the konnector */ | ||
konnectorName: PropTypes.string.isRequired, | ||
/** Callback used when the user close the paywall */ | ||
onClose: PropTypes.func.isRequired | ||
} | ||
|
||
export default withPaywallLocales(MaxAccountsByKonnectorPaywall) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
export { default as OnlyOfficePaywall } from './OnlyOfficePaywall' | ||
export { default as PasswordSharingPaywall } from './PasswordSharingPaywall' | ||
export { | ||
default as MaxAccountsByKonnectorPaywall | ||
} from './MaxAccountsByKonnectorPaywall' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters