Skip to content

Commit 114f101

Browse files
authored
Release Newsletter form (#6712)
1 parent ccf0d52 commit 114f101

File tree

4 files changed

+11
-30
lines changed

4 files changed

+11
-30
lines changed

packages/web/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@radix-ui/react-icons": "1.3.2",
1717
"@radix-ui/react-tabs": "1.1.2",
1818
"@radix-ui/react-tooltip": "1.1.6",
19-
"@theguild/components": "9.7.0",
19+
"@theguild/components": "9.7.1",
2020
"date-fns": "4.1.0",
2121
"next": "15.2.4",
2222
"react": "19.0.0",

packages/web/docs/src/app/blog/components/newsletter-form-card.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ export function NewsletterFormCard(props: React.HTMLAttributes<HTMLElement>) {
9797
: undefined
9898
}
9999
message={state?.message}
100+
onChange={() => {
101+
if (state?.status === 'success') {
102+
setState(undefined);
103+
}
104+
}}
100105
/>
101106
{!state || state.status === 'error' ? (
102107
<CallToAction type="submit" variant="secondary-inverted" className="mt-2 !w-full">

packages/web/docs/src/app/blog/components/posts-by-tag/latest-posts.tsx

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
1-
'use client';
2-
3-
// ^ todo: this "use client" is temporary until we test the newsletter card on prod
4-
import { useEffect, useState } from 'react';
51
import { Heading } from '@theguild/components';
62
import { BlogPostFile } from '../../blog-types';
73
import { BlogCard } from '../blog-card';
84
import { prettyPrintTag } from '../pretty-print-tag';
95

10-
// There's a CORS error from deploy previews and I'd rather test it before giving it to users.
11-
function useTemporaryFeatureFlag() {
12-
const [visible, setVisible] = useState(false);
13-
14-
useEffect(() => {
15-
const searchParams = new URLSearchParams(window.location.search);
16-
const flag = searchParams.get('newsletter-form-card');
17-
if (flag === '1') {
18-
setVisible(true);
19-
}
20-
}, []);
21-
22-
return visible;
23-
}
24-
256
export function LatestPosts({
267
posts,
278
tag,
@@ -31,11 +12,6 @@ export function LatestPosts({
3112
tag: string | null;
3213
children?: React.ReactNode;
3314
}) {
34-
// TODO: remove this once we test the newsletter card on prod
35-
if (!useTemporaryFeatureFlag()) {
36-
children = undefined;
37-
}
38-
3915
// it needs to be 12, because we have 2/3/4 column layouts
4016
const itemsInFirstSection = children ? 11 : 12;
4117
const firstTwelve = posts.slice(0, itemsInFirstSection);

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)