tooltips are created

This commit is contained in:
MuhammadKhalilzadeh committed 2024-05-09 13:37:11 +03:30
1 parent 316fc44aeb
commit 188768c259
5 files changed
+113 -1

No files matched your search

@@ -0,0 +1,46 @@
import "./tooltipWithTail.css";
import React from "react";
import { styled } from "@mui/material/styles";
import Button from "@mui/material/Button";
import Tooltip, { TooltipProps, tooltipClasses } from "@mui/material/Tooltip";
import HelpOutlineIcon from "@mui/icons-material/HelpOutline";
const CustomizedTooltip = styled(
({ className, placement, arrow, ...props }: TooltipProps) => (
<Tooltip
{...props}
placement={placement}
arrow={arrow}
classes={{ popper: className }}
/>
)
)(({ theme }) => ({
[`& .${tooltipClasses.tooltip}`]: {
backgroundColor: "black",
},
[`& .${tooltipClasses.arrow}`]: {
color: "black",
},
}));
function TooltipWithTail({ placement, arrow = false, title, text }) {
return (
<div>
<CustomizedTooltip
arrow={arrow}
placement={placement}
title={
<React.Fragment>
{title && <div className="tooltip-title">{title}</div>}
<div className="tooltip-description">{text}</div>
</React.Fragment>
}
className="tooltip-holder"
>
<HelpOutlineIcon style={{ fill: "#98A2B3" }} />
</CustomizedTooltip>
</div>
);
}
export default TooltipWithTail;
@@ -0,0 +1,21 @@
:root {
--tooltip-color-0: #d0d5dd;
--tooltip-margin: 5px;
--tooltip-font-size: 12px;
}
.tooltip-title {
font-size: var(--tooltip-font-size);
font-weight: bold;
margin: var(--tooltip-margin);
}
.tooltip-description {
font-size: var(--tooltip-font-size);
color: var(--tooltip-color-0);
margin: var(--tooltip-margin);
}
/* box-shadow:
0px 12px 16px -4px rgba(16, 24, 40, 0.08),
0px 4px 6px -2px rgba(16, 24, 40, 0.03); */