chore: remove Letterspace newsletter integration and all LETTERSPACE_* variables

This commit is contained in:
2026-02-21 10:56:43 +01:00
parent ce30eca574
commit c85fa7798e
15 changed files with 4 additions and 225 deletions

View File

@@ -1,6 +1,3 @@
PUBLIC_API_URL=https://sexy.pivoine.art/api
PUBLIC_URL=https://sexy.pivoine.art
PUBLIC_UMAMI_ID=
LETTERSPACE_API_URL=
LETTERSPACE_API_KEY=
LETTERSPACE_LIST_ID=

View File

@@ -1,119 +0,0 @@
<script lang="ts">
import { _ } from "svelte-i18n";
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
} from "$lib/components/ui/dialog";
import { Button } from "$lib/components/ui/button";
import { Separator } from "$lib/components/ui/separator";
import type { Snippet } from "svelte";
import Label from "../ui/label/label.svelte";
import Input from "../ui/input/input.svelte";
import { toast } from "svelte-sonner";
interface Props {
open: boolean;
email: string;
children?: Snippet;
}
let isLoading = $state(false);
async function handleSubscription(e: Event) {
e.preventDefault();
try {
isLoading = true;
await fetch("/newsletter", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ email }),
});
toast.success(
$_("newsletter_signup.toast_subscribe", { values: { email } }),
);
} finally {
isLoading = false;
open = false;
}
}
let { open = $bindable(), email = $bindable() }: Props = $props();
</script>
<Dialog bind:open>
<DialogContent class="sm:max-w-md">
<DialogHeader class="space-y-4">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<div
class="w-10 h-10 rounded-full bg-gradient-to-br from-primary to-purple-600 flex items-center justify-center shrink-0 grow-0"
>
<span class="icon-[ri--newspaper-line]"></span>
</div>
<div class="">
<DialogTitle
class="text-left text-xl font-semibold text-primary-foreground"
>{$_('newsletter_signup.title')}</DialogTitle
>
<DialogDescription class="text-left text-sm">
{$_('newsletter_signup.description')}
</DialogDescription>
</div>
</div>
</div>
</DialogHeader>
<Separator class="my-4" />
<form onsubmit={handleSubscription}>
<!-- Email -->
<div class="space-y-2 flex gap-4 items-center">
<Label for="email" class="m-0">{$_('newsletter_signup.email')}</Label>
<Input
id="email"
type="email"
placeholder={$_('newsletter_signup.email_placeholder')}
bind:value={email}
required
class="bg-background/50 border-primary/20 focus:border-primary"
/>
</div>
<Separator class="my-8" />
<!-- Close Button -->
<div class="flex justify-end gap-4">
<Button
variant="ghost"
size="sm"
onclick={() => (open = false)}
class="text-muted-foreground hover:text-foreground cursor-pointer"
>
<span class="icon-[ri--close-large-line]"></span>
{$_('newsletter_signup.close')}
</Button>
<Button
variant="default"
size="sm"
type="submit"
class="cursor-pointer"
disabled={isLoading}
>
{#if isLoading}
<div
class="w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin mr-2"
></div>
{$_('newsletter_signup.subscribing')}
{:else}
<span class="icon-[ri--check-line]"></span>
{$_('newsletter_signup.subscribe')}
{/if}
</Button>
</div>
</form>
</DialogContent>
</Dialog>

View File

@@ -1,26 +0,0 @@
<script>
import { _ } from "svelte-i18n";
import { Button } from "../ui/button";
import { Card, CardContent } from "../ui/card";
import NewsletterSignupPopup from "./newsletter-signup-popup.svelte";
let isPopupOpen = $state(false);
let { email = "" } = $props();
</script>
<!-- Newsletter Signup -->
<Card class="p-0 not-last:bg-gradient-to-br from-primary/10 to-accent/10">
<CardContent class="p-6 text-center">
<h3 class="font-semibold mb-2">{$_('newsletter_signup.title')}</h3>
<p class="text-sm text-muted-foreground mb-4">
{$_('newsletter_signup.description')}
</p>
<Button
onclick={() => (isPopupOpen = true)}
target="_blank"
class="cursor-pointer w-full bg-gradient-to-r from-primary to-accent hover:from-primary/90 hover:to-accent/90"
>{$_('newsletter_signup.cta')}</Button
>
<NewsletterSignupPopup bind:open={isPopupOpen} {email} />
</CardContent>
</Card>

View File

@@ -870,18 +870,6 @@ export default {
exit: "Exit",
exit_url: "https://pivoine.art",
},
newsletter_signup: {
title: "Stay Updated",
description:
"Get the latest articles and insights delivered to your inbox.",
email: "Email",
email_placeholder: "your@email.com",
cta: "Subscribe to Newsletter",
close: "Close",
subscribe: "Subscribe",
subscribing: "Subscribing",
toast_subscribe: "Your email has been added to the newsletter list!",
},
sharing_popup_button: {
share: "Share",
},

View File

@@ -123,7 +123,6 @@ class Logger {
PUBLIC_API_URL: process.env.PUBLIC_API_URL,
PUBLIC_URL: process.env.PUBLIC_URL,
PUBLIC_UMAMI_ID: process.env.PUBLIC_UMAMI_ID ? '***set***' : 'not set',
LETTERSPACE_API_URL: process.env.LETTERSPACE_API_URL || 'not set',
PORT: process.env.PORT || '3000',
HOST: process.env.HOST || '0.0.0.0',
};

View File

@@ -9,7 +9,6 @@ import { getAssetUrl } from "$lib/directus";
import SharingPopup from "$lib/components/sharing-popup/sharing-popup.svelte";
import Meta from "$lib/components/meta/meta.svelte";
import PeonyBackground from "$lib/components/background/peony-background.svelte";
import NewsletterSignup from "$lib/components/newsletter-signup/newsletter-signup-widget.svelte";
import SharingPopupButton from "$lib/components/sharing-popup/sharing-popup-button.svelte";
const { data } = $props();
@@ -215,8 +214,6 @@ const timeAgo = new TimeAgo("en");
</Card>
-->
<!-- <NewsletterSignup email={data.authStatus.user?.email}/> -->
<!-- Back to Magazine -->
<Button
variant="outline"

View File

@@ -1,22 +0,0 @@
import {
LETTERSPACE_API_KEY,
LETTERSPACE_API_URL,
LETTERSPACE_LIST_ID,
} from "$env/static/private";
import { json } from "@sveltejs/kit";
export async function POST({ request, fetch }) {
const { email } = await request.json();
const lists = [LETTERSPACE_LIST_ID];
await fetch(`${LETTERSPACE_API_URL}/subscribers`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": LETTERSPACE_API_KEY,
},
body: JSON.stringify({ email, lists }),
});
return json({ email }, { status: 201 });
}

View File

@@ -16,7 +16,6 @@ import { formatVideoDuration, getUserInitials } from "$lib/utils";
import { invalidateAll } from "$app/navigation";
import { toast } from "svelte-sonner";
import { createCommentForVideo, likeVideo, unlikeVideo, recordVideoPlay, updateVideoPlay } from "$lib/services";
import NewsletterSignup from "$lib/components/newsletter-signup/newsletter-signup-widget.svelte";
import SharingPopupButton from "$lib/components/sharing-popup/sharing-popup-button.svelte";
const { data } = $props();
@@ -539,8 +538,6 @@ let showPlayer = $state(false);
</CardContent>
</Card> -->
<!-- <NewsletterSignup /> -->
<!-- Back to Videos -->
<Button
variant="outline"