Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Feat: Support notes as tooltips for district rows as well #1476

Merged
merged 1 commit into from
Apr 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 36 additions & 13 deletions src/components/row.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,19 @@ function Row(props) {
}
onMouseLeave={() => props.onHighlightDistrict?.()}
>
<td style={{fontWeight: 600}}>{district}</td>
<td className="unknown" style={{fontWeight: 600}}>
{district}
<span onClick={handleTooltip}>
<span
data-for="unknown"
data-tip={[[sortedDistricts[district].notes]]}
data-event="touchstart mouseover"
data-event-off="mouseleave"
>
{sortedDistricts[district].notes && <Icon.Info />}
</span>
</span>
</td>
<td>
<span className="deltas" style={{color: '#ff073a'}}>
{sortedDistricts[district].delta.confirmed > 0 && (
Expand Down Expand Up @@ -312,23 +324,14 @@ function Row(props) {
<span onClick={handleTooltip}>
<span
data-for="unknown"
data-tip={[
'Awaiting patient-level details from State Bulletin',
]}
data-tip={
'Awaiting patient-level details from State Bulletin'
}
data-event="touchstart mouseover"
data-event-off="mouseleave"
>
<Icon.Info />
</span>
<ReactTooltip
id="unknown"
place="right"
type="dark"
effect="solid"
multiline={true}
scrollHide={true}
globalEventOff="click"
/>
</span>
</td>
<td>
Expand All @@ -348,6 +351,26 @@ function Row(props) {
</React.Fragment>
)}

{showDistricts && (
<React.Fragment>
<tr>
<td colSpan={2}>
<span className="unknown">
<ReactTooltip
id="unknown"
place="right"
type="dark"
effect="solid"
multiline={true}
scrollHide={true}
globalEventOff="click"
/>
</span>
</td>
</tr>
</React.Fragment>
)}

<tr
className={`spacer`}
style={{display: props.reveal && !props.total ? '' : 'none'}}
Expand Down