@@ -19,7 +19,6 @@ import { getSnapshot } from "../../states/snapshot";
1919import { cn } from "../../utils/cn" ;
2020import { AnimatedModal } from "../common/AnimatedModal" ;
2121import { Button } from "../common/Button" ;
22- import { Fa } from "../common/Fa" ;
2322import { UserBadge } from "../common/UserBadge" ;
2423import { Checkbox } from "../ui/form/Checkbox" ;
2524import { InputField } from "../ui/form/InputField" ;
@@ -42,7 +41,7 @@ export function EditProfile() {
4241 website : snapshot . details ?. socialProfiles ?. website ?? "" ,
4342 showActivityOnPublicProfile :
4443 snapshot . details ?. showActivityOnPublicProfile ?? true ,
45- badgeId : badges . find ( ( b ) => b . selected ) ?. id ?? null ,
44+ badgeId : badges . find ( ( b ) => b . selected ) ?. id ?? - 1 ,
4645 } ,
4746 onSubmit : async ( { value } ) => {
4847 const updates = {
@@ -59,7 +58,7 @@ export function EditProfile() {
5958 const response = await Ape . users . updateProfile ( {
6059 body : {
6160 ...updates ,
62- selectedBadgeId : value . badgeId ?? undefined ,
61+ selectedBadgeId : value . badgeId ,
6362 } ,
6463 } ) ;
6564
@@ -226,25 +225,7 @@ export function EditProfile() {
226225 < form . Field name = "badgeId" >
227226 { ( field ) => (
228227 < div class = "flex flex-wrap gap-2" >
229- < Button
230- class = { cn ( "p-0 opacity-25 hover:opacity-100" , {
231- "opacity-100" : field ( ) . state . value === null ,
232- } ) }
233- active = { field ( ) . state . value === null }
234- onClick = { ( ) => field ( ) . handleChange ( null ) }
235- >
236- < div
237- class = "rounded-[0.5em] p-1.5 text-em-sm"
238- style = { {
239- background : "var(--sub-color)" ,
240- color : "var(--text-color)" ,
241- } }
242- >
243- < Fa icon = "fa-frown-open" />
244- < span class = "pl-[0.75em]" > none</ span >
245- </ div >
246- </ Button >
247- < For each = { badges } >
228+ < For each = { [ { id : - 1 } , ...badges ] } >
248229 { ( badge ) => (
249230 < Button
250231 class = { cn ( "p-0 opacity-25 hover:opacity-100" , {
0 commit comments