Closed frankcollins3 closed 1 year ago
got it:
const handleClick = (index:number) => {
👍 console.log($(`#timeSpan${index}`))
let indexTargetSpan = $(`#timeSpan${index}`)[0]
console.log('indexTargetSpan')
console.log(indexTargetSpan)
console.log(indexTargetSpan.innerText)
heres the id on the element that uses string interpolation to assert that particular element's index in the map as ID suffix
<div className="timeline-text">
<span
id={`timeSpan${index}`}
className="timeline-display"
style={{ color: '#00000030' }} // style={{ color: `${disabled[index] ? '#00000030' : '#000000'}` }}
>
{time <= 12 ? time : time - 12} {time < 12 ? 'am' : 'pm'}
</span>
{/* {isShown && <div className="timeline-hover"><img src="/water_img/mouse_droplet.png" /></div>} */}
</div>
[8:01pm]
heres that string that could have 22.67 / 23 fl oz 8 am
https://github.com/frankcollins3/fill_container/assets/73137934/99d12f11-1861-451f-b41c-74d5882691cb
state starts out as '', a successful intake of water according to time specified by pg.table.settings is "check"
this picture captures that successful update of data: which would be adhering to schedule & the needed water intake amount 👍 newStatus[index] = 'check'
first proposed approach: 0: includes the jquery targeting performed.
1: give an id that factors in the .map() index to the "22.6 fl oz 8am" string.