@@ -6,6 +6,7 @@ import PixelContainer from './PixelContainer';
66import RetroText from './RetroText' ;
77import RetroButton from './RetroButton' ;
88import { Upload , ImageIcon , X } from 'lucide-react' ;
9+ import { Button } from "./ui/button" ;
910
1011const chainOptions = [
1112 { value : "eth" , label : "Ethereum" } ,
@@ -66,6 +67,7 @@ const ConfessionForm = ({ onSubmitConfession }: ConfessionFormProps) => {
6667 const newConfession = {
6768 text : formData . text ,
6869 chain : formData . chain ,
70+ degenRating : 1 // Add default degenRating to fix the null constraint issue
6971 } ;
7072
7173 try {
@@ -89,15 +91,6 @@ const ConfessionForm = ({ onSubmitConfession }: ConfessionFormProps) => {
8991 }
9092 } ;
9193
92- const handleReset = ( ) => {
93- setFormData ( {
94- text : "" ,
95- chain : "eth"
96- } ) ;
97- setMediaFile ( null ) ;
98- setMediaPreview ( null ) ;
99- } ;
100-
10194 const handleMediaChange = ( e : React . ChangeEvent < HTMLInputElement > ) => {
10295 if ( e . target . files && e . target . files [ 0 ] ) {
10396 const file = e . target . files [ 0 ] ;
@@ -139,28 +132,29 @@ const ConfessionForm = ({ onSubmitConfession }: ConfessionFormProps) => {
139132 } ;
140133
141134 return (
142- < PixelContainer className = "w-full max-w-2xl mx-auto" >
135+ < div className = "w-full max-w-2xl mx-auto bg-gradient-to-b from-terminal-purple/10 to-terminal-darkgray p-6 rounded-lg shadow-xl backdrop-blur-sm border border-terminal-purple/30 " >
143136 < form onSubmit = { handleSubmit } className = "space-y-6" >
144137 < div >
145- < RetroText glowing className = "text-2xl mb-2 text-terminal-purple" >
146- { '>' } NEW CONFESSION
147- </ RetroText >
138+ < h2 className = "text-2xl mb-4 text-white font-bold flex items-center" >
139+ < span className = "bg-terminal-purple text-white px-3 py-1 rounded mr-2" > NEW</ span >
140+ < span className = "bg-clip-text text-transparent bg-gradient-to-r from-terminal-purple to-terminal-cyan" > CONFESSION</ span >
141+ </ h2 >
148142
149143 < textarea
150144 value = { formData . text }
151145 onChange = { ( e ) => setFormData ( { ...formData , text : e . target . value } ) }
152- className = "w-full h-40 bg-terminal-darkgray text-terminal-green border-2 border-terminal-purple p-3 font-vt323 text-lg focus:outline-none focus:ring-2 focus:ring-terminal-purple"
146+ className = "w-full h-40 bg-terminal-darkgray/80 text-terminal-green border border-terminal-purple/50 p-4 rounded-md font-vt323 text-lg focus:outline-none focus:ring-2 focus:ring-terminal-purple transition-all shadow-inner "
153147 placeholder = "I panic sold at the bottom and told everyone I diamond handed..."
154148 disabled = { isSubmitting }
155149 />
156150 </ div >
157151
158152 < div >
159- < RetroText className = "mb-2 text-terminal-cyan" > { '>' } SELECT CHAIN</ RetroText >
153+ < label className = "block mb-2 text-terminal-cyan font-medium" > SELECT CHAIN</ label >
160154 < select
161155 value = { formData . chain }
162156 onChange = { ( e ) => setFormData ( { ...formData , chain : e . target . value } ) }
163- className = "w-full bg-terminal-darkgray text-terminal-green border-2 border-terminal-purple p-2 font-vt323 text-lg focus:outline-none focus:ring-2 focus:ring-terminal-purple"
157+ className = "w-full bg-terminal-darkgray/80 text-terminal-green border border-terminal-purple/50 p-3 rounded-md font-vt323 text-lg focus:outline-none focus:ring-2 focus:ring-terminal-purple transition-all "
164158 disabled = { isSubmitting }
165159 >
166160 { chainOptions . map ( ( option ) => (
@@ -172,26 +166,26 @@ const ConfessionForm = ({ onSubmitConfession }: ConfessionFormProps) => {
172166 </ div >
173167
174168 < div >
175- < RetroText className = "mb-2 text-terminal-cyan" > { '>' } ATTACH MEDIA (OPTIONAL)</ RetroText >
169+ < label className = "block mb-2 text-terminal-cyan font-medium" > ATTACH MEDIA (OPTIONAL)</ label >
176170
177171 { mediaPreview ? (
178- < div className = "relative border-2 border-terminal-purple p-2 mb-4" >
179- < img src = { mediaPreview } alt = "Preview" className = "max-h-64 mx-auto" />
172+ < div className = "relative border border-terminal-purple/50 rounded-md p-2 mb-4 bg-terminal-darkgray/40 " >
173+ < img src = { mediaPreview } alt = "Preview" className = "max-h-64 mx-auto rounded " />
180174 < button
181175 type = "button"
182176 onClick = { removeMedia }
183- className = "absolute top-2 right-2 bg-terminal-purple text-terminal-black p-1 rounded-full"
177+ className = "absolute top-2 right-2 bg-terminal-purple text-white p-1 rounded-full hover:bg-terminal-purple/80 transition-colors "
184178 disabled = { isSubmitting }
185179 >
186180 < X size = { 16 } />
187181 </ button >
188182 </ div >
189183 ) : (
190- < label className = "flex flex-col items-center justify-center w-full h-32 border-2 border-dashed border-terminal-purple bg-terminal-darkgray rounded-lg cursor-pointer hover:bg-terminal-purple/10 " >
184+ < label className = "flex flex-col items-center justify-center w-full h-32 border border-dashed border-terminal-purple/50 bg-terminal-darkgray/40 rounded-md cursor-pointer hover:bg-terminal-darkgray/60 transition-colors " >
191185 < div className = "flex flex-col items-center justify-center pt-5 pb-6" >
192186 < ImageIcon className = "w-10 h-10 mb-3 text-terminal-purple" />
193- < RetroText className = "mb-2 text-sm text-terminal-purple" > < span className = "font-semibold" > Click to upload</ span > image or GIF</ RetroText >
194- < RetroText className = "text-xs text-terminal-purple/60" > PNG, JPG, WEBP or GIF (MAX. 5MB)</ RetroText >
187+ < p className = "mb-2 text-sm text-terminal-purple" > < span className = "font-semibold" > Click to upload</ span > image or GIF</ p >
188+ < p className = "text-xs text-terminal-purple/60" > PNG, JPG, WEBP or GIF (MAX. 5MB)</ p >
195189 </ div >
196190 < input
197191 type = "file"
@@ -204,30 +198,25 @@ const ConfessionForm = ({ onSubmitConfession }: ConfessionFormProps) => {
204198 ) }
205199 </ div >
206200
207- < div className = "flex gap-4" >
208- < RetroButton type = "submit" disabled = { isSubmitting || ! user } >
209- { isSubmitting ? 'SUBMITTING...' : 'Submit Confession' }
210- </ RetroButton >
211-
212- < RetroButton
213- onClick = { handleReset }
214- className = "bg-terminal-darkgray border-terminal-lightpurple shadow-[4px_4px_0px_0px_rgba(126,105,171,1)] hover:shadow-[2px_2px_0px_0px_rgba(126,105,171,1)]"
215- disabled = { isSubmitting }
216- type = "button"
201+ < div >
202+ < Button
203+ type = "submit"
204+ disabled = { isSubmitting || ! user }
205+ className = "w-full bg-gradient-to-r from-terminal-purple to-terminal-cyan hover:opacity-90 text-white font-bold py-3 px-8 rounded-md transition-all shadow-lg hover:shadow-terminal-purple/30 hover:translate-y-[-2px]"
217206 >
218- Confess Again
219- </ RetroButton >
207+ { isSubmitting ? 'SUBMITTING...' : 'SUBMIT CONFESSION' }
208+ </ Button >
220209 </ div >
221210
222211 { ! user && (
223- < div className = "mt-2 p-3 bg-terminal-purple/10 border-l-2 border-terminal-purple" >
224- < RetroText className = "text-terminal-purple" >
225- Please < a href = "/auth" className = "underline" > sign in</ a > to submit your confession
226- </ RetroText >
212+ < div className = "mt-2 p-4 bg-terminal-purple/10 border-l-4 border-terminal-purple rounded " >
213+ < p className = "text-terminal-purple" >
214+ Please < a href = "/auth" className = "underline font-medium " > sign in</ a > to submit your confession
215+ </ p >
227216 </ div >
228217 ) }
229218 </ form >
230- </ PixelContainer >
219+ </ div >
231220 ) ;
232221} ;
233222
0 commit comments