Skip to content

Commit

Permalink
feat: temporarily add prompt to vote on Radicale Vernieuwers
Browse files Browse the repository at this point in the history
  • Loading branch information
th0rgall committed Nov 4, 2024
1 parent 549a215 commit 76d74d7
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 58 deletions.
25 changes: 2 additions & 23 deletions src/lib/components/Nav/Mobile/MobileNav/SideDrawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -77,29 +77,8 @@
<li class="socials">
<Socials small />
</li>
<li class="superfan-bar" class:show={!$user?.superfan || shouldRenewalNotice}>
{#if !$user?.superfan}
<span class="title">{$_('navigation.membership-notice.prompt')}</span>
<span
>{@html $_('navigation.membership-notice.answer', {
values: {
linkText: anchorText({
href: routes.ABOUT_MEMBERSHIP,
track: [
PlausibleEvent.VISIT_ABOUT_MEMBERSHIP,
{ source: 'side_navbar_announcement' }
],
linkText: $_('navigation.membership-notice.link-text'),
style: 'text-decoration: underline; cursor: pointer;',
newtab: false
})
}
})}</span
>
{:else if shouldRenewalNotice}
<span class="title">{$renewalNoticeContent?.prompt}</span>
<span>{@html $renewalNoticeContent?.answerHtml}</span>
{/if}
<li class="superfan-bar show">
<span>{@html $_('rv.ask')}</span>
</li>
<li class="main-links-container">
<ul class="main-links">
Expand Down
39 changes: 4 additions & 35 deletions src/lib/components/Nav/Top/TopNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,17 @@
import { user } from '$lib/stores/auth';
import WtmgLogo from '../../UI/WTMGLogo.svelte';
import { COMMUNITY_FORUM_URL } from '$lib/constants';
import { anchorText } from '$lib/util/translation-helpers';
import { PlausibleEvent } from '$lib/types/Plausible';
import trackEvent from '$lib/util/track-plausible';
import { renewalNoticeContent, subscriptionJustEnded } from '$lib/stores/subscription';
$: firstName = $user ? $user.firstName : '';
$: shouldShowRenewalTopBar = $user && $user.stripeSubscription && $subscriptionJustEnded;
$: shouldShowTopBar = !$user?.superfan || shouldShowRenewalTopBar;
$: shouldShowTopBar = true;
</script>

<nav>
{#if shouldShowTopBar}
<div class="nav-extra">
<!-- Inform non-superfans of the membership offering -->
{#if !$user?.superfan}
<span
><strong style="font-weight: 500;">{$_('navigation.membership-notice.prompt')}</strong
>{@html $_('navigation.membership-notice.answer', {
values: {
linkText: anchorText({
href: routes.ABOUT_MEMBERSHIP,
track: [
PlausibleEvent.VISIT_ABOUT_MEMBERSHIP,
{ source: 'top_navbar_announcement' }
],
linkText: $_('navigation.membership-notice.link-text'),
style: 'text-decoration: underline; cursor: pointer;',
newtab: false
})
}
})}
</span>
{:else if shouldShowRenewalTopBar && $user.stripeSubscription}
<!-- Inform renewal amount -->
<span
><strong style="font-weight: 500;">
{$renewalNoticeContent?.prompt}</strong
>{' '}{@html $renewalNoticeContent?.answerHtml}
</span>
{/if}
</div>
{/if}
<div class="nav-extra">
<span>{@html $_('rv.ask')}</span>
</div>
<div class="main-nav">
<WtmgLogo />
<ul>
Expand Down
3 changes: 3 additions & 0 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1498,5 +1498,8 @@
"permission-denied-faq-text": "Anleitungen dazu finden Sie in unseren FAQ",
"generic": "Beim Aktivieren mobiler Benachrichtigungen ist ein Fehler aufgetreten. Können Sie diese Seite aktualisieren und dann erneut versuchen, sie zu aktivieren? Wenn dies nicht funktioniert, senden Sie bitte die folgenden Informationen an {emailLink} und wir helfen Ihnen weiter. Vielen Dank!"
}
},
"rv": {
"ask": "Wir sind als <a style=\"font-style: italic;\" class=\"link--neutral\" href=\"https://www.radicalevernieuwers.be/inspiratie/welcome-to-my-garden\" target=\"_blank\" rel=\"noopener\"><em>Radicale Vernieuwer</em></a> ausgewählt worden! <a href=\"https://www.radicalevernieuwers.be/publieksprijs\" target=\"_blank\" rel=\"noopener\" class=\"link--neutral\">Stimmen Sie mitt für WTMG</a> für den Publikumspreis? Vielen Dank! 🎉💚"
}
}
3 changes: 3 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,9 @@
"rethink": "Rethink"
}
},
"rv": {
"ask": "We’ve been selected as <a style=\"font-style: italic;\" class=\"link--neutral\" href=\"https://www.radicalevernieuwers.be/inspiratie/welcome-to-my-garden\" target=\"_blank\" rel=\"noopener\"><em>Radicale Vernieuwer</em></a>! Can you <a href=\"https://www.radicalevernieuwers.be/publieksprijs\" target=\"_blank\" rel=\"noopener\" class=\"link--neutral\">please vote for WTMG</a> for the audience award? Thank you! 🎉💚"
},
"fallback": {
"404": "404 - page not found",
"redirect": "back to home"
Expand Down
3 changes: 3 additions & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1496,5 +1496,8 @@
"permission-denied-faq-text": "instrucciones en nuestras preguntas frecuentes",
"generic": "Algo salió mal al activar las notificaciones móviles. ¿Puedes actualizar esta página e intentar activarlas de nuevo? Si esto no funciona, envíanos la siguiente información a {emailLink} para que podamos ayudarte mejor. ¡Gracias!"
}
},
"rv": {
"ask": "¡Hemos sido seleccionados como <a style=\"font-style: italic;\" class=\"link--neutral\" href=\"https://www.radicalevernieuwers.be/inspiratie/welcome-to-my-garden\" target=\"_blank\" rel=\"noopener\"><em>Radicale Vernieuwer</em></a>! ¿Puede <a href=\"https://www.radicalevernieuwers.be/publieksprijs\" target=\"_blank\" rel=\"noopener\" class=\"link--neutral\">votar por WTMG</a> para el premio del público?"
}
}
3 changes: 3 additions & 0 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1489,5 +1489,8 @@
"permission-denied": "Votre navigateur bloque actuellement les notifications mobiles pour WTMG. Pour les activer, autorisez les notifications dans votre navigateur. Suivez {faqLink}. Cela ne prend que deux minutes !\"",
"generic": "Un problème s’est produit lors de l’activation de vos notifications mobiles. Pouvez-vous actualiser cette page et réessayer de les activer ? Si cela ne fonctionne pas, merci d'envoyer les informations ci-dessous à {emailLink} afin que nous puissions vous aider. Merci !"
}
},
"rv": {
"ask": "Nous avons été sélectionnés comme <a style=\"font-style: italic;\" class=\"link--neutral\" href=\"https://www.radicalevernieuwers.be/inspiratie/welcome-to-my-garden\" target=\"_blank\" rel=\"noopener\"><em>Radicale Vernieuwer</em></a>! Pouvez-vous <a href=\"https://www.radicalevernieuwers.be/publieksprijs\" target=\"_blank\" rel=\"noopener\" class=\"link--neutral\">voter pour WTMG</a> pour le prix du public ? Merci ! 🎉💚"
}
}
3 changes: 3 additions & 0 deletions src/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1496,5 +1496,8 @@
"permission-denied": "Jouw browser blokkeert momenteel mobiele meldingen voor WTMG. Werk de toestemmingen van jouw browser bij of reset ze om mobiele meldingen aan te zetten. Volg eenvoudigweg {faqLink}. Het duurt slechts twee minuten!",
"generic": "Er is iets misgegaan bij het aanzetten van je mobiele meldingen. Kan je deze pagina verversen en dan nogmaals proberen om ze aan te zetten? Als dit niet werkt, gelieve dan onderstaande informatie naar {emailLink} te sturen zodat we je verder kunnen helpen. Bedankt!"
}
},
"rv": {
"ask": "We zijn geselecteerd als <a style=\"font-style: italic;\" class=\"link--neutral\" href=\"https://www.radicalevernieuwers.be/inspiratie/welcome-to-my-garden\" target=\"_blank\" rel=\"noopener\"><em>Radicale Vernieuwer</em></a>! <a href=\"https://www.radicalevernieuwers.be/publieksprijs\" target=\"_blank\" rel=\"noopener\" class=\"link--neutral\">Stem je mee op WTMG</a> voor de publieksprijs? Bedankt! 🎉💚"
}
}

0 comments on commit 76d74d7

Please sign in to comment.