feat: apply various dashboard and auth fixes including demo trials, settings UI, and signup options
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
"use client"
|
||||
"use client"
|
||||
|
||||
import { useState, useEffect } from "react"
|
||||
import { CollegePredictorCard } from "@/components/AI/CollegePredictorCard"
|
||||
import { Card, CardContent } from "@/components/ui/card"
|
||||
import { GraduationCap, Building2, Award, CheckCircle2, TrendingUp, MapPin, Users, BarChart2 } from "lucide-react"
|
||||
import Link from "next/link"
|
||||
|
||||
import { useActiveUser, isDemoUser } from "@/hooks/useActiveUser"
|
||||
const DEMO_IDS = new Set([
|
||||
"11111111-1111-1111-1111-111111111111",
|
||||
"22222222-2222-2222-2222-222222222222",
|
||||
"33333333-3333-3333-3333-333333333333",
|
||||
"44444444-4444-4444-4444-444444444444"
|
||||
]);
|
||||
|
||||
function isDemoUser(id: string): boolean {
|
||||
return !!id && DEMO_IDS.has(id);
|
||||
}
|
||||
|
||||
const CUTOFF_TRENDS = [
|
||||
{ year: "2021", rank: 3800 },
|
||||
@@ -16,8 +26,13 @@ const CUTOFF_TRENDS = [
|
||||
]
|
||||
|
||||
export default function CollegePredictorPage() {
|
||||
const { userId } = useActiveUser()
|
||||
const isDemo = isDemoUser(userId)
|
||||
const [isDemo, setIsDemo] = useState(false);
|
||||
useEffect(() => {
|
||||
if (typeof window !== 'undefined') {
|
||||
const id = localStorage.getItem('activeUserId');
|
||||
setIsDemo(isDemoUser(id ?? ''));
|
||||
}
|
||||
}, []);
|
||||
const maxRank = Math.max(...CUTOFF_TRENDS.map(d => d.rank))
|
||||
|
||||
return (
|
||||
|
||||
14
src/app/dashboard/ai-coach/layout.tsx
Normal file
14
src/app/dashboard/ai-coach/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from "react"
|
||||
import { PremiumGate } from "@/components/PremiumGate"
|
||||
|
||||
export default function AICoachLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
return (
|
||||
<PremiumGate featureKey="ai-tutor-chat">
|
||||
{children}
|
||||
</PremiumGate>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user