frankcollins3 / Next-Water-App

Happy, Healthy Water Cycling App that tracks user/human fluid intake.
https://next-water-app.vercel.app
1 stars 0 forks source link

component-composition / encapsulation is overreaching [8:26pm] #70

Closed frankcollins3 closed 11 months ago

frankcollins3 commented 11 months ago

attempting to do: use <Boop> which is manual animation based on "npm i react-spring". It makes the child <elem/> dance L -> R upon hover ternary to hide the boat, which is really a loading bar driving back and forth in the cup.

error: Screen Shot 2023-07-19 at 8 30 09 PM

proposed approach: 0: I had two separate conditional rendering statements that used: DATA && <elem>

instead of: DATA ? : </img/>

// also this is the first time I"m trying to wrap 2 image elements in a ternary. I always toggle the img src={var || var2}

approach is returning to that approach. there will be two lines based on same state instead of 1 but that's better than app crash

frankcollins3 commented 11 months ago

👍 { SELECTED_WEB_ICONS && <img className={styles.icon} src={NON_GOOGLE_IMG_URL || '/water_img/squid.png'}/> }

frankcollins3 commented 11 months ago

👍 rather

                { SELECTED_WEB_ICONS
                        ?
              <Boop rotateAngle={45} speed={800} setImg={SET_NON_GOOGLE_IMG_URL} iconScreenFlag={nothingFunc} showBoat={nothingFunc} boat={nothingFunc} className={styles.icon}>
                <img className={styles.icon} src={NON_GOOGLE_IMG_URL || '/water_img/squid.png'}/>
              </Boop>                  
                        :
        <img className="boat" id={styles.boat} src={boat}/>
                }

[8:35pm]