@@ -4,7 +4,8 @@ import { useSubscription } from "@/hooks/useSubscription";
44import { useRouter } from "next/navigation" ;
55import { useEffect , useState } from "react" ;
66import { useSession } from "next-auth/react" ;
7- import { trpc } from "@/lib/trpc" ;
7+ import Link from "next/link" ;
8+ import { Play } from "lucide-react" ;
89
910export default function ProDashboardPage ( ) {
1011 const { isPaidUser, isLoading } = useSubscription ( ) ;
@@ -13,19 +14,6 @@ export default function ProDashboardPage() {
1314 const [ error , setError ] = useState < string | null > ( null ) ;
1415 const [ isJoining , setIsJoining ] = useState ( false ) ;
1516
16- // Check if user has already submitted a testimonial
17- const { data : testimonialData } = (
18- trpc as any
19- ) . testimonial . getMyTestimonial . useQuery ( undefined , {
20- enabled : ! ! isPaidUser ,
21- retry : false ,
22- refetchOnWindowFocus : true ,
23- refetchOnMount : true ,
24- staleTime : 0 , // Always fetch fresh data
25- } ) ;
26-
27- const hasSubmittedTestimonial = ! ! testimonialData ?. testimonial ;
28-
2917 useEffect ( ( ) => {
3018 if ( ! isLoading && ! isPaidUser ) {
3119 router . push ( "/pricing" ) ;
@@ -94,7 +82,7 @@ export default function ProDashboardPage() {
9482 return ;
9583 }
9684
97- window . open ( slackInviteUrl , "_blank" , "noopener,noreferrer" ) ;
85+ window . location . href = slackInviteUrl ;
9886 } catch ( err ) {
9987 console . error ( "Failed to join community:" , err ) ;
10088 setError ( "Failed to connect to server" ) ;
@@ -123,27 +111,26 @@ export default function ProDashboardPage() {
123111 soon you'll see all the pro perks here. thanks for investin!
124112 </ h1 >
125113 { isPaidUser && (
126- < div className = "mt-6" >
127- < div className = "flex flex-wrap gap-4 justify-center" >
128- < button
129- onClick = { handleJoinSlack }
130- disabled = { isJoining }
131- className = "px-4 py-2 bg-brand-purple hover:bg-brand-purple-light text-text-primary font-medium rounded-lg transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed text-sm"
132- >
133- { isJoining ? "Joining..." : "Join Slack" }
134- </ button >
135- { ! hasSubmittedTestimonial && (
136- < button
137- onClick = { ( ) => router . push ( "/testimonials/submit" ) }
138- className = "px-4 py-2 bg-brand-purple hover:bg-brand-purple-light text-text-primary font-medium rounded-lg transition-colors duration-200 text-sm"
139- >
140- Submit Testimonial
141- </ button >
142- ) }
143- </ div >
144- { error && < p className = "text-error-text text-sm mt-2" > { error } </ p > }
114+ < div className = "mt-6 flex flex-col sm:flex-row items-center justify-center gap-3" >
115+ < Link
116+ href = "/dashboard/pro/sessions"
117+ className = "inline-flex items-center gap-2 px-4 py-2 bg-brand-purple hover:bg-brand-purple-light text-text-primary font-medium rounded-lg transition-colors duration-200 text-sm"
118+ >
119+ < Play className = "w-4 h-4" />
120+ Pro Sessions
121+ </ Link >
122+ < button
123+ onClick = { handleJoinSlack }
124+ disabled = { isJoining }
125+ className = "px-4 py-2 bg-dash-surface border border-dash-border hover:border-brand-purple/50 text-text-primary font-medium rounded-lg transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed text-sm"
126+ >
127+ { isJoining ? "Joining..." : "Join Slack" }
128+ </ button >
145129 </ div >
146130 ) }
131+ { error && (
132+ < p className = "text-error-text text-sm mt-2 text-center" > { error } </ p >
133+ ) }
147134 </ div >
148135 </ div >
149136 ) ;
0 commit comments