Skip to content

Commit

Permalink
feat: added unsubscribed notificiation
Browse files Browse the repository at this point in the history
  • Loading branch information
mwargan committed Apr 26, 2024
1 parent 635f3f9 commit 49aca64
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -459,4 +459,16 @@ article:not(:has(table)) {
/** Fix link as button in nav margin @todo add back to vue3-starter-kit */
nav a[role=button] {
margin-top: 0;
}

/** Fix inconsistent margins and borders when used in groups */
[role=group] .dropdown:not(:first-child),
[role=search] .dropdown:not(:first-child) {
margin-left: calc(var(--pico-border-width) * -1);
}

[role=group]>:not(:first-child)>summary,
[role=search]>:not(:first-child)>summary {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
8 changes: 8 additions & 0 deletions src/eventBus/listeners/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,12 @@ export default {
5000
).show();
},
[eventTypes.unsubscribed]: () => {
new CustomNotification(
"success",
t("You have been unsubscribed."),
["browser"],
5000
).show();
},
} as Record<eventTypes, any>;
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,5 +276,6 @@
"Create your first Smart Magic Link": "Create your first Smart Magic Link",
"Edit destination": "Edit destination",
"No data available": "No data available",
"No destinations yet": "No destinations yet"
"No destinations yet": "No destinations yet",
"You have been unsubscribed.": "You have been unsubscribed."
}
3 changes: 2 additions & 1 deletion src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,5 +276,6 @@
"Create your first Smart Magic Link": "Créez votre premier lien magique intelligent",
"Edit destination": "Modifier la destination",
"No data available": "Pas de données disponibles",
"No destinations yet": "Pas encore de destinations"
"No destinations yet": "Pas encore de destinations",
"You have been unsubscribed.": "Vous avez été désabonné."
}
2 changes: 2 additions & 0 deletions src/views/SingleRedirectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ const getData = () => {
onMounted(() => {
$bus.$on(eventTypes.started_subscription, getData);
$bus.$on(eventTypes.unsubscribed, getData);
getData();
});
onUnmounted(() => {
$bus.$off(eventTypes.started_subscription, getData);
$bus.$off(eventTypes.unsubscribed, getData);
});
</script>
<template>
Expand Down

0 comments on commit 49aca64

Please sign in to comment.