+
}
+ data-testid="general-observer"
+ className="mdx-embed"
+ >
{isChildVisible ? children :
}
);
};
-
-export default GeneralObserver;
diff --git a/src/components/NewsletterSignup/NewsletterBannerDetailed.tsx b/src/components/NewsletterSignup/NewsletterBannerDetailed.tsx
deleted file mode 100644
index 5d54c7fd..00000000
--- a/src/components/NewsletterSignup/NewsletterBannerDetailed.tsx
+++ /dev/null
@@ -1,139 +0,0 @@
-import React, { useEffect, useState } from 'react';
-import useNewsletterStats from '@hooks/useNewsletterStats';
-import { Code, CornerRightDown, Rocket, Zap } from 'lucide-react';
-import { usePostHog } from 'posthog-js/react';
-
-import { Avatar } from '@components/Avatar';
-import { Badge } from '@components/Badge';
-import { Headshot } from '@components/Headshot';
-import { SubscriptionForm } from '@components/SubscriptionForm';
-
-const NewsletterBannerDetailed = () => {
- const posthog = usePostHog();
- const { subscriberCount } = useNewsletterStats();
- const [titleIndex, setTitleIndex] = useState(0);
-
- // calculate the number of days until the next Tuesday
- const daysUntilNextTuesday = (2 - new Date().getDay() + 7) % 7;
-
- let daysText;
-
- switch (daysUntilNextTuesday) {
- case 0:
- daysText = 'today';
- break;
- case 1:
- daysText = 'tomorrow';
- break;
- default:
- daysText = `in ${daysUntilNextTuesday} days`;
- }
-
- useEffect(() => {
- if (posthog) {
- const testVariant = posthog.getFeatureFlag('newsletter-title-test');
- setTitleIndex(parseInt(testVariant as string) || 0);
- }
- }, [posthog]);
-
- const titleOptions = [
- {
- title: 'Tiny Improvements for Product Builders',
- tagline: 'Weekly insights on design, dev, and startup growth',
- buttonText: 'Start Improving',
- },
- {
- title: "The Product Builder's Toolkit",
- tagline: 'Actionable tips for developers and founders',
- buttonText: 'Get the Tools',
- },
- {
- title: 'From Code to Launch',
- tagline: 'Navigate the journey from dev to founder',
- buttonText: 'Begin My Journey',
- },
- {
- title: 'Frontend to Founder',
- tagline: 'Weekly lessons in product development and startup life',
- buttonText: 'Level Up My Career',
- },
- {
- title: "The Tech Founder's Compass",
- tagline: 'Guiding devs through product and startup challenges',
- buttonText: 'Find My Direction',
- },
- ];
-
- return (
-
-
-
-
-
- {titleOptions[titleIndex].title}
-
-
- {titleOptions[titleIndex].tagline}
-
-
-
-
-
-
-
Mike Bifulco
-
- CTO Craftwork (S23), Ex-Google/Stripe/Microsoft
-
-
-
-
- Join{' '}
-
- {subscriberCount ?? 'thousands of'}
- {' '}
- developers, founders, and product builders getting smarter every
- week.
-
-
-
-
Front-End Dev
-
-
- Design Principles
-
-
- Founder Tips
-
-
-
-
-
-
- Next issue drops {daysText}!
-
-
-
-
- No spam. Unsubscribe anytime.
-
-
-
-
-
-
- );
-};
-
-export default NewsletterBannerDetailed;
diff --git a/src/components/PolitePop/PolitePop.tsx b/src/components/PolitePop/PolitePop.tsx
index bb4e3aec..3167d0f8 100644
--- a/src/components/PolitePop/PolitePop.tsx
+++ b/src/components/PolitePop/PolitePop.tsx
@@ -12,7 +12,7 @@ type ConfirmButtonProps = {
const emailIsGmail = (email?: string) => {
if (!email) return false;
- return email?.endsWith('@gmail.com');
+ return email.endsWith('@gmail.com');
};
const ConfirmButton: React.FC
= ({ email, onClick }) => {
@@ -149,9 +149,7 @@ const PolitePopEmbed = ({ debug = false }) => {
Confirm your address by clicking the link I sent to
{' '}
- {subscribeEvent?.email
- ? subscribeEvent?.email
- : 'your inbox'}
+ {subscribeEvent?.email ?? 'your inbox'}
.
diff --git a/src/components/Post/TableOfContents.tsx b/src/components/Post/TableOfContents.tsx
index 60c9c03d..d43540f5 100644
--- a/src/components/Post/TableOfContents.tsx
+++ b/src/components/Post/TableOfContents.tsx
@@ -18,8 +18,8 @@ function useHighlighted(id: string) {
useEffect(() => {
const handleObserver = (entries: IntersectionObserverEntry[]) => {
- entries?.forEach((entry) => {
- if (entry?.isIntersecting) {
+ entries.forEach((entry) => {
+ if (entry.isIntersecting) {
setActiveId(entry.target.id);
}
});
@@ -61,13 +61,13 @@ const ToCLink: React.FC<{ heading: Heading }> = ({ heading }) => {
const TableOfContents: React.FC = ({ headings }) => {
if (!headings) return null;
- if (!headings?.length) return null;
+ if (!headings.length) return null;
return (