@@ -23,30 +23,18 @@ export function ProfileScreen() {
2323 const [ avoidColors , setAvoidColors ] = useState ( profile . avoidColors || [ ] )
2424 const [ patterns , setPatterns ] = useState ( profile . patterns || [ ] )
2525 const [ stylePrefs , setStylePrefs ] = useState ( profile . stylePrefs || '' )
26- const [ outfits , setOutfits ] = useState ( profile . outfits || [ ] ) // array of dataUrls
2726 const [ saved , setSaved ] = useState ( false )
2827
2928 const toggleArr = ( arr , setArr , val ) => {
3029 setArr ( arr . includes ( val ) ? arr . filter ( ( v ) => v !== val ) : [ ...arr , val ] )
3130 }
3231
33- const handleOutfitUpload = useCallback ( ( e ) => {
34- const files = Array . from ( e . target . files || [ ] )
35- if ( ! files . length ) return
36- const remaining = 5 - outfits . length
37- files . slice ( 0 , remaining ) . forEach ( ( file ) => {
38- const reader = new FileReader ( )
39- reader . onload = ( ev ) => setOutfits ( ( prev ) => [ ...prev , ev . target . result ] . slice ( 0 , 5 ) )
40- reader . readAsDataURL ( file )
41- } )
42- } , [ outfits ] )
43-
4432 const handleSave = useCallback ( ( ) => {
45- saveProfile ( { height, weight, bodyType, colorPrefs, avoidColors, patterns, stylePrefs, outfits } )
33+ saveProfile ( { height, weight, bodyType, colorPrefs, avoidColors, patterns, stylePrefs } )
4634 setSaved ( true )
47- speak ( 'Profile saved. The app will use this to personalise your suggestions .' )
35+ speak ( 'Profile saved. Shopping mode and outfit suggestions will now respect your colour and style preferences .' )
4836 setTimeout ( ( ) => setSaved ( false ) , 2000 )
49- } , [ height , weight , bodyType , colorPrefs , avoidColors , patterns , stylePrefs , outfits , saveProfile , speak ] )
37+ } , [ height , weight , bodyType , colorPrefs , avoidColors , patterns , stylePrefs , saveProfile , speak ] )
5038
5139 return (
5240 < Screen title = "My Profile" subtitle = "All fields are optional" >
@@ -69,30 +57,6 @@ export function ProfileScreen() {
6957 < ChipGroup label = "Style" options = { STYLE_OPTIONS } selected = { [ stylePrefs ] } onToggle = { ( v ) => setStylePrefs ( stylePrefs === v ? '' : v ) } single />
7058 </ Section >
7159
72- < Section label = { `My Outfits (${ outfits . length } /5)` } >
73- < p style = { { fontSize : 13 , color : COLORS . TEXT_MUTED , lineHeight : 1.6 , marginBottom : 12 , marginTop : 0 } } >
74- Upload up to 5 outfits you already wear. The AI will learn your style from them.
75- </ p >
76- < div style = { { display : 'flex' , gap : 8 , flexWrap : 'wrap' , marginBottom : outfits . length < 5 ? 12 : 0 } } >
77- { outfits . map ( ( src , i ) => (
78- < div key = { i } style = { { position : 'relative' , width : 72 , height : 72 } } >
79- < img src = { src } alt = { `Outfit ${ i + 1 } ` } style = { { width : '100%' , height : '100%' , objectFit : 'cover' , borderRadius : COLORS . RADIUS , border : `2px solid ${ COLORS . BORDER } ` } } />
80- < button
81- onClick = { ( ) => setOutfits ( outfits . filter ( ( _ , j ) => j !== i ) ) }
82- aria-label = { `Remove outfit ${ i + 1 } ` }
83- style = { { position : 'absolute' , top : - 8 , right : - 8 , width : 22 , height : 22 , borderRadius : '50%' , background : COLORS . DANGER , border : 'none' , color : '#fff' , fontSize : 12 , fontWeight : 900 , cursor : 'pointer' , display : 'flex' , alignItems : 'center' , justifyContent : 'center' } }
84- > ×</ button >
85- </ div >
86- ) ) }
87- </ div >
88- { outfits . length < 5 && (
89- < label style = { { display : 'inline-flex' , alignItems : 'center' , gap : 8 , border : `2px solid ${ COLORS . BORDER } ` , borderRadius : COLORS . RADIUS , padding : '10px 16px' , cursor : 'pointer' , fontSize : 13 , fontWeight : 700 , color : COLORS . TEXT_MUTED } } >
90- + Add Outfit Photo
91- < input type = "file" accept = "image/*" multiple onChange = { handleOutfitUpload } style = { { display : 'none' } } />
92- </ label >
93- ) }
94- </ Section >
95-
9660 < div style = { { marginTop : 8 } } >
9761 < BigButton
9862 label = { saved ? 'Saved!' : 'Save Profile' }
0 commit comments