Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update tooltip position and rotation in Discussion Notes panel #8938

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
11 changes: 7 additions & 4 deletions src/components/Facility/PatientNotesSlideover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,16 @@ export default function PatientNotesSlideover(props: PatientNotesProps) {
id="expand_doctor_notes"
className={classNames(
"tooltip flex h-8 w-8 cursor-pointer items-center justify-center rounded bg-primary-800 text-secondary-100 text-opacity-70 hover:bg-primary-700 hover:text-opacity-100",
show && "rotate-180",
)}
onClick={() => setShow(!show)}
>
<CareIcon
icon="l-angle-up"
icon={show ? "l-angle-down" : "l-angle-up"}
className="tooltip text-lg transition-all delay-150 duration-300 ease-out"
/>
<span className="tooltip-text tooltip-top rotate-[-180deg] text-xs">
<span
className={`tooltip-text tooltip-${show ? "bottom -translate-x-16" : "top"} text-xs`}
>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use cn or classNames utils to add conditional classes, string interpolation can be hard to read sometimes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{t("minimize")}
</span>
</div>
Expand All @@ -173,7 +174,9 @@ export default function PatientNotesSlideover(props: PatientNotesProps) {
icon="l-times"
className="tooltip text-lg transition-all delay-150 duration-300 ease-out"
/>
<span className="tooltip-text tooltip-bottom -translate-x-11 text-xs">
<span
className={`tooltip-text tooltip-${show ? "bottom -translate-x-11" : "top"} text-xs`}
>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{t("close")}
</span>
</div>
Expand Down
Loading