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,20 +3,17 @@ 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";
} }
export function WhyRatingLogo({ function LogoIcon({ className }: { className?: string }) {
className,
iconClassName,
showWordmark = true,
}: WhyRatingLogoProps) {
return ( return (
<div className={cn("flex items-center gap-2", className)}>
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 120 120" viewBox="0 0 120 120"
className={cn("h-8 w-8", iconClassName)} className={cn("h-8 w-8", className)}
> >
<defs> <defs>
<clipPath id="whyrating-clip"> <clipPath id="whyrating-clip">
@@ -43,50 +40,41 @@ export function WhyRatingLogo({
<circle cx="60" cy="62" r="27" fill="#1E293B" /> <circle cx="60" cy="62" r="27" fill="#1E293B" />
<circle cx="60" cy="62" r="21" fill="#FEF3C7" /> <circle cx="60" cy="62" r="21" fill="#FEF3C7" />
<g clipPath="url(#whyrating-clip)"> <g clipPath="url(#whyrating-clip)">
<rect <rect x="42" y="58" width="11" height="35" rx="1.5" ry="1.5" fill="#86EFAC" />
x="42" <rect x="55" y="51" width="11" height="42" rx="1.5" ry="1.5" fill="#22C55E" />
y="58" <rect x="68" y="44" width="11" height="49" rx="1.5" ry="1.5" fill="#15803D" />
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> </g>
<rect <rect x="68" y="44" width="11" height="18" rx="1.5" ry="1.5" fill="#15803D" />
x="68"
y="44"
width="11"
height="18"
rx="1.5"
ry="1.5"
fill="#15803D"
/>
</g> </g>
</svg> </svg>
);
}
export function WhyRatingLogo({
className,
iconClassName,
wordmarkClassName,
showWordmark = true,
colorScheme = "light",
}: WhyRatingLogoProps) {
const isDark = colorScheme === "dark";
return (
<div className={cn("flex items-center gap-2", className)}>
<LogoIcon className={iconClassName} />
{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,
}); });
} }