Skip to content

Commit 3b23afb

Browse files
committed
Replace buttons in redeem voucher view with new components
1 parent 4377a20 commit 3b23afb

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

desktop/packages/mullvad-vpn/src/renderer/components/RedeemVoucher.tsx

+25-11
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { useAppContext } from '../context';
99
import { Button, ButtonProps, Flex, Spinner } from '../lib/components';
1010
import { IconBadge } from '../lib/icon-badge';
1111
import { useSelector } from '../redux/store';
12-
import * as AppButton from './AppButton';
1312
import { ModalAlert } from './Modal';
1413
import {
1514
StyledEmptyResponse,
@@ -194,9 +193,14 @@ export function RedeemVoucherSubmitButton() {
194193
const disabled = submitting || response?.type === 'success';
195194

196195
return (
197-
<AppButton.GreenButton disabled={!valueValid || disabled} onClick={onSubmit}>
198-
{messages.pgettext('redeem-voucher-view', 'Redeem')}
199-
</AppButton.GreenButton>
196+
<Button variant="success" disabled={!valueValid || disabled} onClick={onSubmit}>
197+
<Button.Text>
198+
{
199+
// TRANSLATORS: Button label for voucher redemption.
200+
messages.pgettext('redeem-voucher-view', 'Redeem')
201+
}
202+
</Button.Text>
203+
</Button>
200204
);
201205
}
202206

@@ -220,9 +224,9 @@ export function RedeemVoucherAlert(props: IRedeemVoucherAlertProps) {
220224
<ModalAlert
221225
isOpen={props.show}
222226
buttons={[
223-
<AppButton.BlueButton key="gotit" onClick={props.onClose}>
224-
{messages.gettext('Got it!')}
225-
</AppButton.BlueButton>,
227+
<Button key="gotit" onClick={props.onClose}>
228+
<Button.Text>{messages.gettext('Got it!')}</Button.Text>
229+
</Button>,
226230
]}
227231
close={props.onClose}>
228232
<Flex $justifyContent="center" $margin={{ top: 'large', bottom: 'medium' }}>
@@ -245,12 +249,22 @@ export function RedeemVoucherAlert(props: IRedeemVoucherAlertProps) {
245249
isOpen={props.show}
246250
buttons={[
247251
<RedeemVoucherSubmitButton key="submit" />,
248-
<AppButton.BlueButton key="cancel" disabled={submitting} onClick={props.onClose}>
249-
{messages.pgettext('redeem-voucher-alert', 'Cancel')}
250-
</AppButton.BlueButton>,
252+
<Button key="cancel" disabled={submitting} onClick={props.onClose}>
253+
<Button.Text>
254+
{
255+
// TRANSLATORS: Cancel button label for voucher redemption.
256+
messages.pgettext('redeem-voucher-alert', 'Cancel')
257+
}
258+
</Button.Text>
259+
</Button>,
251260
]}
252261
close={props.onClose}>
253-
<StyledLabel>{messages.pgettext('redeem-voucher-alert', 'Enter voucher code')}</StyledLabel>
262+
<StyledLabel>
263+
{
264+
// TRANSLATORS: Input field label for voucher code.
265+
messages.pgettext('redeem-voucher-alert', 'Enter voucher code')
266+
}
267+
</StyledLabel>
254268
<RedeemVoucherInput />
255269
<RedeemVoucherResponse />
256270
</ModalAlert>

0 commit comments

Comments
 (0)