Skip to content

Commit

Permalink
fix: popover now covers the image action buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
orlinmalkja committed Jan 6, 2025
1 parent 913e745 commit 09d4701
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/CustomHTML.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const CustomHTML: FC<CustomHTMLProps> = ({ textHtml, width, icon }) => {
const iconEls = ref.current.children
if (iconEls && iconEls.length > 0) {
iconEl = iconEls[0]

Check warning on line 26 in src/components/CustomHTML.tsx

View workflow job for this annotation

GitHub Actions / build (18)

Assignments to the 'iconEl' variable from inside React Hook useEffect will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside useEffect
iconEl.classList.add('t-w-'+icon.width, 't-h-'+icon.height)
iconEl.classList.add('t-w-' + icon.width, 't-h-' + icon.height)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/panel/PanelTopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const PanelTopBar: FC <PanelTopBarProps>= ({panelId}) => {
<div className="panel-top-bar t-mb-6 t-flex">
<Popover>
<PopoverTrigger className="open-tree-button t-h-8 t-w-10 t-relative">
<CustomHTML textHtml={tree} width="100" icon={{type: 'icon', width:5, height: 5}} />
<CustomHTML textHtml={tree} icon={{type: 'icon', width:6, height: 6}} />
</PopoverTrigger>
<PopoverContent className="t-bg-white t-absolute">
<PopoverContent className="t-bg-white t-absolute t-z-10">
<div className="t-flex t-flex-col t-pt-4 t-pl-3 t-w-80 t-shadow-md t-border-[1px] t-border-solid t-border-gray-300 t-rounded-md">
<span className="t-font-bold">
Enter a collection/manifest Url
Expand Down
4 changes: 2 additions & 2 deletions src/components/panel/TextViewsToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ const TextViewsToggle: FC <TextViewsToggleProps>= ({panelId}) => {
const buttons =
Object.keys(textViewsIcons).map((title, i) => (
<button
className="t-px-0.5 t-py-1 t-w-7 t-h-7 t-rounded t-mr-3"
className="t-px-1 t-py-1 t-w-7 t-h-7 t-rounded t-mr-3"
key={i}
onClick={(e) => handleTextViewClick(e, i)}
style={{'backgroundColor':(textViewIndex === i) ? '#E5E7EB': 'transparent'}}
>
<CustomHTML textHtml={textViewsIcons[title as keyof IconKeys]} icon={{type:'icon', width: 6, height:5}} />
<CustomHTML textHtml={textViewsIcons[title as keyof IconKeys]} icon={{type:'icon', width: 3, height:2}} />
</button>
));

Expand Down

0 comments on commit 09d4701

Please sign in to comment.