diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2020-02-26 16:07:30 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2020-04-06 17:47:10 +0200 |
| commit | f8efaf18de195f33e6fdf390a3b94e0fa0c4e6e4 (patch) | |
| tree | 6abd977ec78c64358e3776c103746678484d7154 /gui/src/renderer/containers | |
| parent | dab4202bea4b5cfe9121cee513b61a3fb45bbb19 (diff) | |
| download | mullvadvpn-f8efaf18de195f33e6fdf390a3b94e0fa0c4e6e4.tar.xz mullvadvpn-f8efaf18de195f33e6fdf390a3b94e0fa0c4e6e4.zip | |
Add component for submitting voucher
Diffstat (limited to 'gui/src/renderer/containers')
| -rw-r--r-- | gui/src/renderer/containers/RedeemVoucherContainer.tsx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gui/src/renderer/containers/RedeemVoucherContainer.tsx b/gui/src/renderer/containers/RedeemVoucherContainer.tsx new file mode 100644 index 0000000000..1aeee8c719 --- /dev/null +++ b/gui/src/renderer/containers/RedeemVoucherContainer.tsx @@ -0,0 +1,19 @@ +import { connect } from 'react-redux'; +import { bindActionCreators } from 'redux'; +import { RedeemVoucher } from '../components/RedeemVoucher'; +import withAppContext, { IAppContext } from '../context'; +import { ReduxDispatch } from '../redux/store'; +import accountActions from '../redux/account/actions'; + +const mapDispatchToProps = (dispatch: ReduxDispatch, props: IAppContext) => { + const account = bindActionCreators(accountActions, dispatch); + + return { + submitVoucher: (voucherCode: string) => { + return props.app.submitVoucher(voucherCode); + }, + updateAccountExpiry: account.updateAccountExpiry, + }; +}; + +export default withAppContext(connect(null, mapDispatchToProps)(RedeemVoucher)); |
