summaryrefslogtreecommitdiffhomepage
path: root/gui/src/shared
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2020-07-15 14:58:27 +0200
committerOskar Nyberg <oskar@mullvad.net>2020-07-22 15:49:04 +0200
commit7f5f6a3d0e4a61784ca75b53e4850c4dec108d95 (patch)
tree4f55aae0c81e3e2f034ca61df4301abde6ec6963 /gui/src/shared
parentf694c41fc4bd5b16b63c2ec6edb83d0dcce75d37 (diff)
downloadmullvadvpn-7f5f6a3d0e4a61784ca75b53e4850c4dec108d95.tar.xz
mullvadvpn-7f5f6a3d0e4a61784ca75b53e4850c4dec108d95.zip
Add notification action buttons in macOS
Diffstat (limited to 'gui/src/shared')
-rw-r--r--gui/src/shared/notifications/account-expired.ts7
-rw-r--r--gui/src/shared/notifications/close-to-account-expiry.ts7
-rw-r--r--gui/src/shared/notifications/notification.ts7
-rw-r--r--gui/src/shared/notifications/unsupported-version.ts6
4 files changed, 23 insertions, 4 deletions
diff --git a/gui/src/shared/notifications/account-expired.ts b/gui/src/shared/notifications/account-expired.ts
index ea600aa577..c89845bc4b 100644
--- a/gui/src/shared/notifications/account-expired.ts
+++ b/gui/src/shared/notifications/account-expired.ts
@@ -28,7 +28,12 @@ export class AccountExpiredNotificationProvider implements SystemNotificationPro
),
critical: true,
presentOnce: { value: true, name: this.constructor.name },
- action: { type: 'open-url', url: links.purchase, withAuth: true },
+ action: {
+ type: 'open-url',
+ url: links.purchase,
+ withAuth: true,
+ text: messages.pgettext('notifications', 'Buy more'),
+ },
};
}
}
diff --git a/gui/src/shared/notifications/close-to-account-expiry.ts b/gui/src/shared/notifications/close-to-account-expiry.ts
index b30aff2542..ad1969929f 100644
--- a/gui/src/shared/notifications/close-to-account-expiry.ts
+++ b/gui/src/shared/notifications/close-to-account-expiry.ts
@@ -41,7 +41,12 @@ export class CloseToAccountExpiryNotificationProvider
return {
message,
critical: true,
- action: { type: 'open-url', url: links.purchase, withAuth: true },
+ action: {
+ type: 'open-url',
+ url: links.purchase,
+ withAuth: true,
+ text: messages.pgettext('notifications', 'Buy more'),
+ },
};
}
diff --git a/gui/src/shared/notifications/notification.ts b/gui/src/shared/notifications/notification.ts
index 98b50d4d24..adbf3ae746 100644
--- a/gui/src/shared/notifications/notification.ts
+++ b/gui/src/shared/notifications/notification.ts
@@ -1,4 +1,9 @@
-export type NotificationAction = { type: 'open-url'; url: string; withAuth?: boolean };
+export type NotificationAction = {
+ type: 'open-url';
+ url: string;
+ text?: string;
+ withAuth?: boolean;
+};
export type InAppNotificationIndicatorType = 'success' | 'warning' | 'error';
diff --git a/gui/src/shared/notifications/unsupported-version.ts b/gui/src/shared/notifications/unsupported-version.ts
index fd2e0b5c72..097a142815 100644
--- a/gui/src/shared/notifications/unsupported-version.ts
+++ b/gui/src/shared/notifications/unsupported-version.ts
@@ -27,7 +27,11 @@ export class UnsupportedVersionNotificationProvider
return {
message,
critical: true,
- action: { type: 'open-url', url: links.download },
+ action: {
+ type: 'open-url',
+ url: links.download,
+ text: messages.pgettext('notifications', 'Upgrade'),
+ },
presentOnce: { value: true, name: this.constructor.name },
suppressInDevelopment: true,
};