Skip to content

Commit

Permalink
left highlight for active plugin icon
Browse files Browse the repository at this point in the history
  • Loading branch information
LianaHus authored and Aniket-Engg committed Dec 4, 2023
1 parent 715d5f9 commit 9a2c425
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 42 deletions.
83 changes: 44 additions & 39 deletions libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,49 +84,54 @@ const Icon = ({iconRecord, verticalIconPlugin, contextMenuAction, theme}: IconPr
}
}, [])


const stylePC = iconRecord.active ? 'flex-start' : 'center'
return (
<>
<CustomTooltip
placement={name === 'settings' ? 'right' : name === 'search' ? 'top' : name === 'udapp' ? 'bottom' : 'top'}
tooltipText={title}
delay={{show: 1000, hide: 0}}
>
<div
className={`remixui_icon m-2 pt-1`}
onClick={() => {
;(verticalIconPlugin as any).toggle(name)
}}
{...{plugin: name}}
onContextMenu={(e: any) => {
e.preventDefault()
e.stopPropagation()
handleContextMenu(e)
}}
data-id={`verticalIconsKind${name}`}
id={`verticalIconsKind${name}`}
ref={iconRef}
<div className='d-flex' style={{width: 'auto', placeContent: stylePC}}>
{iconRecord.active && <div className='pt-1 bg-primary' style={{width: "6px", height: "36px", position: 'relative'}}></div>}
<CustomTooltip
placement={name === 'settings' ? 'right' : name === 'search' ? 'top' : name === 'udapp' ? 'bottom' : 'top'}
tooltipText={title}
delay={{show: 1000, hide: 0}}
>
<img
data-id={iconRecord.active ? `selected` : ''}
className={`${theme === 'dark' ? 'invert' : ''} ${theme} remixui_image ${iconRecord.active ? `selected-${theme}` : ''}`}
src={icon}
alt={name}
<div
className={`remixui_icon m-0 pt-1`}
onClick={() => {
;(verticalIconPlugin as any).toggle(name)
}}
{...{plugin: name}}
onContextMenu={(e: any) => {
e.preventDefault()
e.stopPropagation()
handleContextMenu(e)
}}
data-id={`verticalIconsKind${name}`}
id={`verticalIconsKind${name}`}
ref={iconRef}
>
<img
data-id={iconRecord.active ? `selected` : ''}
className={`${theme === 'dark' ? 'invert' : ''} ${theme} remixui_image ${iconRecord.active ? `selected-${theme}` : ''}`}
src={icon}
alt={name}
/>
<Badge badgeStatus={badgeStatus} />
</div>
</CustomTooltip>
{showContext ? (
<VerticalIconsContextMenu
pageX={pageX}
pageY={pageY}
links={links}
profileName={name}
hideContextMenu={closeContextMenu}
canBeDeactivated={canDeactivate}
verticalIconPlugin={verticalIconPlugin}
contextMenuAction={contextMenuAction}
/>
<Badge badgeStatus={badgeStatus} />
</div>
</CustomTooltip>
{showContext ? (
<VerticalIconsContextMenu
pageX={pageX}
pageY={pageY}
links={links}
profileName={name}
hideContextMenu={closeContextMenu}
canBeDeactivated={canDeactivate}
verticalIconPlugin={verticalIconPlugin}
contextMenuAction={contextMenuAction}
/>
) : null}
) : null}
</div>
</>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
width: 42px;
height: 42px;
cursor: pointer;
}
justify-content: space-between;
align-self: center;
}
.remixui_homeIcon:hover {
box-shadow: 0px 0px 14px -7px;
}
Expand All @@ -17,8 +19,6 @@
.remixui_icons {
display: flex;
flex-flow: column nowrap;
justify-content: space-between;
align-items: center;
}
.remixui_icon:hover {
box-shadow: 0px 0px 14px -7px;
Expand Down

0 comments on commit 9a2c425

Please sign in to comment.