@@ -5,6 +5,7 @@ import type React from "react";
55import { useState } from "react" ;
66import type { ThirdwebClient } from "thirdweb" ;
77import { NotificationsButton } from "@/components/notifications/notification-button" ;
8+ import { NavLink } from "@/components/ui/NavLink" ;
89import type { Account } from "@/hooks/useApi" ;
910import { AccountButton } from "./account-button.client" ;
1011import { ResourcesDropdownButton } from "./ResourcesDropdownButton" ;
@@ -37,8 +38,12 @@ export function SecondaryNavLinks() {
3738 const [ showFeedbackDropdown , setShowFeedbackDropdown ] = useState ( false ) ;
3839 const [ modalFeedback , setModalFeedback ] = useState ( "" ) ;
3940
40- const handleModalSubmit = ( ) => {
41- console . log ( "Modal feedback sent:" , modalFeedback ) ;
41+ const handleModalSubmit = ( e ?: React . FormEvent ) => {
42+ e ?. preventDefault ( ) ;
43+ // Avoid logging PII in production. Keep minimal diagnostics in dev.
44+ if ( process . env . NODE_ENV !== "production" ) {
45+ console . debug ( "[feedback] length:" , modalFeedback . trim ( ) . length ) ;
46+ }
4247 setModalFeedback ( "" ) ;
4348 setShowFeedbackDropdown ( false ) ;
4449 } ;
@@ -71,48 +76,64 @@ export function SecondaryNavLinks() {
7176 </ button >
7277
7378 { showFeedbackDropdown && (
74- < div className = "absolute top-full right-0 mt-2 bg-background border border-border rounded-2xl p-3 w-96 z-50" >
75- < h2 className = "text-foreground text-base font-sans mb-2" >
79+ < div
80+ id = "feedback-dropdown"
81+ role = "dialog"
82+ aria-labelledby = "feedback-heading"
83+ className = "absolute top-full right-0 mt-2 bg-background border border-border rounded-2xl p-3 w-96 z-50"
84+ >
85+ < h2
86+ id = "feedback-heading"
87+ className = "text-foreground text-base font-sans mb-2"
88+ >
7689 Share your feedback with us:
7790 </ h2 >
91+ < form onSubmit = { handleModalSubmit } className = "contents" >
92+ < label htmlFor = "feedback-text" className = "sr-only" >
93+ Feedback
94+ </ label >
95+ < textarea
96+ id = "feedback-text"
97+ value = { modalFeedback }
98+ onChange = { ( e ) => setModalFeedback ( e . target . value ) }
99+ maxLength = { 1000 }
100+ aria-describedby = "feedback-help"
101+ className = "w-full bg-background text-foreground rounded-lg p-4 min-h-[120px] resize-none border border-border focus:border-border focus:outline-none placeholder-muted-foreground font-sans mb-4 text-sm"
102+ placeholder = "Tell us what you think..."
103+ />
78104
79- < textarea
80- value = { modalFeedback }
81- onChange = { ( e ) => setModalFeedback ( e . target . value ) }
82- className = "w-full bg-background text-foreground rounded-lg p-4 min-h-[120px] resize-none border border-border focus:border-border focus:outline-none placeholder-muted-foreground font-sans mb-4 text-sm"
83- placeholder = "Tell us what you think..."
84- />
85-
86- < div className = "flex items-start justify-between gap-4" >
87- < div className = "text-muted-foreground text-xs font-sans" >
88- < div > Have a technical issue?</ div >
89- < div >
90- < Link
91- href = "/team/~/~/support"
92- className = "underline hover:text-foreground transition-colors"
105+ < div className = "flex items-start justify-between gap-4" >
106+ < div className = "text-muted-foreground text-xs font-sans" >
107+ < div > Have a technical issue?</ div >
108+ < div >
109+ < NavLink
110+ href = "/team/~/support"
111+ className = "underline hover:text-foreground transition-colors"
112+ >
113+ Contact support
114+ </ NavLink >
115+ .
116+ </ div >
117+ </ div >
118+ < div className = "flex gap-2 flex-shrink-0" >
119+ < button
120+ type = "button"
121+ onClick = { handleModalCancel }
122+ className = "bg-transparent text-foreground px-4 py-1.5 rounded-full font-sans text-sm border border-border hover:bg-muted transition-colors"
93123 >
94- Contact support
95- </ Link >
96- .
124+ Cancel
125+ </ button >
126+ < button
127+ type = "submit"
128+ disabled = { ! modalFeedback . trim ( ) }
129+ aria-disabled = { ! modalFeedback . trim ( ) }
130+ className = "bg-primary text-primary-foreground px-4 py-1.5 rounded-full font-sans text-sm hover:bg-primary/90 transition-colors disabled:opacity-50"
131+ >
132+ Submit
133+ </ button >
97134 </ div >
98135 </ div >
99- < div className = "flex gap-2 flex-shrink-0" >
100- < button
101- type = "button"
102- onClick = { handleModalCancel }
103- className = "bg-transparent text-foreground px-4 py-1.5 rounded-full font-sans text-sm border border-border hover:bg-muted transition-colors"
104- >
105- Cancel
106- </ button >
107- < button
108- type = "button"
109- onClick = { handleModalSubmit }
110- className = "bg-primary text-primary-foreground px-4 py-1.5 rounded-full font-sans text-sm hover:bg-primary/90 transition-colors"
111- >
112- Submit
113- </ button >
114- </ div >
115- </ div >
136+ </ form >
116137 </ div >
117138 ) }
118139 </ div >
0 commit comments