feat: enable PostHog session replay and fix checkout origin fallback

- Enable session recording in PostHog provider (was disabled by default)
- Add origin URL fallback in checkout route to prevent Stripe "Not a valid URL" error
- Refactor logo component to extract LogoIcon and add color scheme support
- Add .moat/ to gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-02-22 23:48:38 +00:00
parent 49edf70235
commit c7ee5ce269
4 changed files with 64 additions and 73 deletions

3
.gitignore vendored
View File

@@ -67,3 +67,6 @@ dist/
# Auto Claude data directory # Auto Claude data directory
.auto-claude/ .auto-claude/
# Moat task system
.moat/

View File

@@ -31,7 +31,7 @@ export async function POST(request: NextRequest) {
} }
const stripe = getStripe(); const stripe = getStripe();
const origin = request.headers.get("origin") || ""; const origin = request.headers.get("origin") || process.env.NEXT_PUBLIC_URL || "http://localhost:3000";
const lang = locale || "en"; const lang = locale || "en";
const session = await stripe.checkout.sessions.create({ const session = await stripe.checkout.sessions.create({

View File

@@ -3,90 +3,78 @@ import { cn } from "@turbostarter/ui";
interface WhyRatingLogoProps { interface WhyRatingLogoProps {
className?: string; className?: string;
iconClassName?: string; iconClassName?: string;
wordmarkClassName?: string;
showWordmark?: boolean; showWordmark?: boolean;
colorScheme?: "light" | "dark";
}
function LogoIcon({ className }: { className?: string }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 120 120"
className={cn("h-8 w-8", className)}
>
<defs>
<clipPath id="whyrating-clip">
<circle cx="60" cy="62" r="21" />
</clipPath>
</defs>
<polygon
points="60,15 71.5,42 101,46 79.5,66 85,95 60,82 35,95 40.5,66 19,46 48.5,42"
fill="#FBBC05"
stroke="#FBBC05"
strokeWidth="6"
strokeLinejoin="round"
/>
<g>
<line
x1="83"
y1="81"
x2="95"
y2="91"
stroke="#1E293B"
strokeWidth="9"
strokeLinecap="round"
/>
<circle cx="60" cy="62" r="27" fill="#1E293B" />
<circle cx="60" cy="62" r="21" fill="#FEF3C7" />
<g clipPath="url(#whyrating-clip)">
<rect x="42" y="58" width="11" height="35" rx="1.5" ry="1.5" fill="#86EFAC" />
<rect x="55" y="51" width="11" height="42" rx="1.5" ry="1.5" fill="#22C55E" />
<rect x="68" y="44" width="11" height="49" rx="1.5" ry="1.5" fill="#15803D" />
</g>
<rect x="68" y="44" width="11" height="18" rx="1.5" ry="1.5" fill="#15803D" />
</g>
</svg>
);
} }
export function WhyRatingLogo({ export function WhyRatingLogo({
className, className,
iconClassName, iconClassName,
wordmarkClassName,
showWordmark = true, showWordmark = true,
colorScheme = "light",
}: WhyRatingLogoProps) { }: WhyRatingLogoProps) {
const isDark = colorScheme === "dark";
return ( return (
<div className={cn("flex items-center gap-2", className)}> <div className={cn("flex items-center gap-2", className)}>
<svg <LogoIcon className={iconClassName} />
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 120 120"
className={cn("h-8 w-8", iconClassName)}
>
<defs>
<clipPath id="whyrating-clip">
<circle cx="60" cy="62" r="21" />
</clipPath>
</defs>
<polygon
points="60,15 71.5,42 101,46 79.5,66 85,95 60,82 35,95 40.5,66 19,46 48.5,42"
fill="#FBBC05"
stroke="#FBBC05"
strokeWidth="6"
strokeLinejoin="round"
/>
<g>
<line
x1="83"
y1="81"
x2="95"
y2="91"
stroke="#1E293B"
strokeWidth="9"
strokeLinecap="round"
/>
<circle cx="60" cy="62" r="27" fill="#1E293B" />
<circle cx="60" cy="62" r="21" fill="#FEF3C7" />
<g clipPath="url(#whyrating-clip)">
<rect
x="42"
y="58"
width="11"
height="35"
rx="1.5"
ry="1.5"
fill="#86EFAC"
/>
<rect
x="55"
y="51"
width="11"
height="42"
rx="1.5"
ry="1.5"
fill="#22C55E"
/>
<rect
x="68"
y="44"
width="11"
height="49"
rx="1.5"
ry="1.5"
fill="#15803D"
/>
</g>
<rect
x="68"
y="44"
width="11"
height="18"
rx="1.5"
ry="1.5"
fill="#15803D"
/>
</g>
</svg>
{showWordmark && ( {showWordmark && (
<span className="font-wordmark font-bold text-foreground text-xl"> <span
whyrating.com className={cn(
"font-wordmark font-bold text-xl",
isDark ? "text-zinc-50" : "text-foreground",
wordmarkClassName,
)}
>
whyrating<span className="text-amber-500">.com</span>
</span> </span>
)} )}
</div> </div>
); );
} }
export { LogoIcon };

View File

@@ -27,7 +27,7 @@ if (typeof window !== "undefined" && isValidPosthogConfig) {
person_profiles: "always", person_profiles: "always",
capture_pageview: false, capture_pageview: false,
disable_external_dependency_loading: true, disable_external_dependency_loading: true,
disable_session_recording: true, disable_session_recording: false,
}); });
} }