ToolJet/frontend/src/Editor/LeftSidebar/SidebarComment.jsx
SAI SUMANTH KUMAR 6f0183c32f
Fixed : Show tooltip on comments tab which says indicates that the app needs to be saved to open comments (#1359)
* 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
2021-11-09 09:23:38 +05:30

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();
}}
/>
);
};