mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-08 19:38:51 +01:00
hide when rating btn is clicked
This commit is contained in:
parent
a43d32dcd6
commit
393a4ecfef
@ -17,8 +17,9 @@ const RatingBubble = ({ notification, onRemove }: RatingBubbleProps) => {
|
|||||||
const { id, title, message } = notification;
|
const { id, title, message } = notification;
|
||||||
const [hoveredButtons, setHoveredButtons] = useState<{ [key: number]: boolean }>({});
|
const [hoveredButtons, setHoveredButtons] = useState<{ [key: number]: boolean }>({});
|
||||||
|
|
||||||
const handleRatingClick = (rating: number) => {
|
const handleRatingClick = (id, rating: number) => {
|
||||||
console.log("rating clicked");
|
console.log("rating clicked");
|
||||||
|
onRemove(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleMouseEnter = (buttonIndex: number) => {
|
const handleMouseEnter = (buttonIndex: number) => {
|
||||||
@ -49,7 +50,7 @@ const RatingBubble = ({ notification, onRemove }: RatingBubbleProps) => {
|
|||||||
<Button
|
<Button
|
||||||
key={rating}
|
key={rating}
|
||||||
className={clsx("border-radius-4", hoveredButtons[rating] ? "green" : "grey")}
|
className={clsx("border-radius-4", hoveredButtons[rating] ? "green" : "grey")}
|
||||||
onClick={() => handleRatingClick(rating)}
|
onClick={() => handleRatingClick(id, rating)}
|
||||||
onMouseEnter={() => handleMouseEnter(rating)}
|
onMouseEnter={() => handleMouseEnter(rating)}
|
||||||
onMouseLeave={() => handleMouseLeave(rating)}
|
onMouseLeave={() => handleMouseLeave(rating)}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user