From ef3d062855d18cb3742ddf5b73b4b2511f4b9d3a Mon Sep 17 00:00:00 2001 From: mertbagt Date: Mon, 2 Mar 2026 13:20:59 -0500 Subject: [PATCH 1/4] active element styling --- components/hearing/Transcriptions.tsx | 117 ++++++++++++++++++-------- 1 file changed, 82 insertions(+), 35 deletions(-) diff --git a/components/hearing/Transcriptions.tsx b/components/hearing/Transcriptions.tsx index d9905195e..b085fcff5 100644 --- a/components/hearing/Transcriptions.tsx +++ b/components/hearing/Transcriptions.tsx @@ -1,5 +1,6 @@ import { faMagnifyingGlass, faTimes } from "@fortawesome/free-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" +import ArrowRightAlt from "@mui/icons-material/ArrowRightAlt" import ShareIcon from "@mui/icons-material/Share" import ShareOutlinedIcon from "@mui/icons-material/ShareOutlined" import { useRouter } from "next/router" @@ -14,7 +15,6 @@ import { formatTotalSeconds } from "./hearing" import { ShareLinkButton } from "components/buttons" - import { siteUrl } from "components/links" const ClearButton = styled(FontAwesomeIcon)` @@ -124,8 +124,16 @@ const TranscriptRow = styled(Row)` border-bottom-left-radius: 0.75rem; border-bottom-right-radius: 0.75rem; } + &:hover { + background-color: #d9dfea; + border-color: #1a3185; + border-style: solid; + border-width: 5px; + } ` +const TranscriptRowActive = styled(Row)`` + export const Transcriptions = ({ hearingId, transcriptData, @@ -358,34 +366,32 @@ const TranscriptItem = forwardRef(function TranscriptItem( const [isHovered, setIsHovered] = useState(false) return ( - - - - { - handleClick(element.start) - }} - className={`bg-transparent border-0 text-nowrap p-1`} - type="button" - value={element.start} - > - {formatMilliseconds(element.start)} - {" - "} - {formatMilliseconds(element.end)} - - - - {highlightText(element.text, searchTerm)} - - {isHighlighted(index) ? ( - <> + <> + {isHighlighted(index) ? ( + + + + { + handleClick(element.start) + }} + className={`bg-transparent border-0 text-nowrap p-1`} + type="button" + value={element.start} + > + {formatMilliseconds(element.start)} + {" - "} + {formatMilliseconds(element.end)} + + + + + {highlightText(element.text, searchTerm)} + + {isHovered ? : } - - ) : ( - <> - )} - - + + + ) : ( + setIsHovered(true)} + onMouseLeave={() => setIsHovered(false)} + ref={ref} + > + + + { + handleClick(element.start) + }} + className={`bg-transparent border-0 text-nowrap p-1`} + type="button" + value={element.start} + > + {formatMilliseconds(element.start)} + {" - "} + {formatMilliseconds(element.end)} + + + + + {highlightText(element.text, searchTerm)} + + + { + handleClick(element.start) + }} + className={`bg-transparent border-0 text-nowrap p-1`} + type="button" + value={element.start} + > + {isHovered ? ( + + ) : ( + <> + )} + + + + )} + ) }) From 28d498b4a4202d7e320abbfb7bc5e346965bc9c3 Mon Sep 17 00:00:00 2001 From: mertbagt Date: Mon, 2 Mar 2026 13:29:47 -0500 Subject: [PATCH 2/4] reset hovered onclick --- components/hearing/Transcriptions.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/hearing/Transcriptions.tsx b/components/hearing/Transcriptions.tsx index b085fcff5..cec19e2ee 100644 --- a/components/hearing/Transcriptions.tsx +++ b/components/hearing/Transcriptions.tsx @@ -342,6 +342,7 @@ const TranscriptItem = forwardRef(function TranscriptItem( set currentTime property of