feat(ui): move to React 18 and base for using shadcn/ui (#4174)

Co-authored-by: IbrahimCSAE <ibrahim.mdev@gmail.com>
This commit is contained in:
AlirezaandIbrahimCSAE authored and GitHub committed 2024-05-27 14:30:25 -04:00
1 parent 72b63dcd6a
commit 70f2c797f4
153 files changed
+2973 -2043

No files matched your search

@@ -39,8 +39,8 @@ export default class PortalTooltip extends React.Component {
if (!portalNodes[this.props.group]) {
this.createPortal();
}
let { parent, ...other } = props;
let parentEl = typeof parent === 'string' ? document.querySelector(parent) : parent;
const { parent, ...other } = props;
const parentEl = typeof parent === 'string' ? document.querySelector(parent) : parent;
ReactDOM.render(
<Card
parentEl={parentEl}
@@ -66,8 +66,8 @@ export default class PortalTooltip extends React.Component {
return;
}
let props = { ...nextProps };
let newProps = { ...nextProps };
const props = { ...nextProps };
const newProps = { ...nextProps };
if (portalNodes[this.props.group] && portalNodes[this.props.group].timeout) {
clearTimeout(portalNodes[this.props.group].timeout);
@@ -86,6 +86,7 @@ export default class PortalTooltip extends React.Component {
componentWillUnmount() {
if (portalNodes[this.props.group]) {
// Todo: move this to root.unmount
ReactDOM.unmountComponentAtNode(portalNodes[this.props.group].node);
clearTimeout(portalNodes[this.props.group].timeout);
+5 -13
View File
@@ -36,15 +36,15 @@ const arrowPositionStyle = {
const Tooltip = ({
content,
secondaryContent = null,
isSticky,
position,
isSticky = false,
position = 'bottom',
className,
tight,
tight = false,
children,
isDisabled,
isDisabled = false,
tooltipBoxClassName,
// time to show/hide the tooltip on mouse over and mouse out events (default: 300ms)
showHideDelay,
showHideDelay = 300,
onHide,
}) => {
const [isActive, setIsActive] = useState(false);
@@ -189,14 +189,6 @@ const Tooltip = ({
);
};
Tooltip.defaultProps = {
tight: false,
isSticky: false,
position: 'bottom',
isDisabled: false,
showHideDelay: 300,
};
Tooltip.propTypes = {
isDisabled: PropTypes.bool,
content: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),