From d087a0abc83c07c067d7ac7afff1acc57dad6220 Mon Sep 17 00:00:00 2001
From: Kristóf Marussy <kristof@marussy.com>
Date: Fri, 12 Apr 2024 16:59:31 +0200
Subject: feat(frontend): add tooltips to buttons

---
 subprojects/frontend/src/graph/SlideInPanel.tsx | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

(limited to 'subprojects/frontend/src/graph/SlideInPanel.tsx')

diff --git a/subprojects/frontend/src/graph/SlideInPanel.tsx b/subprojects/frontend/src/graph/SlideInPanel.tsx
index 2c189b5b..47bbe0a6 100644
--- a/subprojects/frontend/src/graph/SlideInPanel.tsx
+++ b/subprojects/frontend/src/graph/SlideInPanel.tsx
@@ -8,6 +8,7 @@ import Dialog from '@mui/material/Dialog';
 import IconButton from '@mui/material/IconButton';
 import Paper from '@mui/material/Paper';
 import Slide from '@mui/material/Slide';
+import Tooltip from '@mui/material/Tooltip';
 import { styled } from '@mui/material/styles';
 import React, { useCallback, useId, useState } from 'react';
 
@@ -58,15 +59,19 @@ export default function SlideInPanel({
 
   return (
     <SlideInPanelRoot anchor={anchor}>
-      <IconButton
-        role="switch"
-        aria-checked={show}
-        aria-controls={dialog ? undefined : id}
-        aria-label={iconLabel}
-        onClick={() => setShow(!show)}
+      <Tooltip
+        title={iconLabel}
+        placement={anchor === 'left' ? 'right' : 'left'}
       >
-        {icon(show)}
-      </IconButton>
+        <IconButton
+          role="switch"
+          aria-checked={show}
+          aria-controls={dialog ? undefined : id}
+          onClick={() => setShow(!show)}
+        >
+          {icon(show)}
+        </IconButton>
+      </Tooltip>
       {dialog ? (
         <Dialog open={show} onClose={close} maxWidth="xl">
           <SlideInDialog close={close} dialog title={title} buttons={buttons}>
-- 
cgit v1.2.3-54-g00ecf

