mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-25 15:37:37 +00:00
* added tooltip * Update frontend/src/Editor/LeftSidebar/SidebarComment.jsx Co-authored-by: Sherfin Shamsudeen <sherfin94@gmail.com> * Fix tooltip not showing up on sidebar item when disabled Fix tooltip not showing up on sidebar item when disabled * Remove if statement around onClick handler - sidebarcomment
22 lines
681 B
JavaScript
22 lines
681 B
JavaScript
import React from 'react';
|
|
import cx from 'classnames';
|
|
import { LeftSidebarItem } from './sidebar-item';
|
|
|
|
export const LeftSidebarComment = ({ toggleComments, appVersionsId }) => {
|
|
const [isActive, toggleActive] = React.useState(false);
|
|
return (
|
|
<LeftSidebarItem
|
|
commentBadge
|
|
tip={appVersionsId ? 'toggle comments' : 'Comments section will be available once you save this application'}
|
|
icon={`comments`}
|
|
className={cx(`left-sidebar-item sidebar-zoom position-relative`, {
|
|
disabled: !appVersionsId,
|
|
active: isActive,
|
|
})}
|
|
onClick={() => {
|
|
toggleActive(!isActive);
|
|
toggleComments();
|
|
}}
|
|
/>
|
|
);
|
|
};
|