From 45cf04caf3d951b702048b73abaa7365a558e258 Mon Sep 17 00:00:00 2001 From: seb Date: Wed, 2 Jul 2025 13:27:31 +0200 Subject: [PATCH] Add GitHub issue reporting feature and tooltips for FABs in App.js --- src/App.js | 88 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 67 insertions(+), 21 deletions(-) diff --git a/src/App.js b/src/App.js index 88c4909..ecf7896 100644 --- a/src/App.js +++ b/src/App.js @@ -11,8 +11,10 @@ import CssBaseline from "@mui/material/CssBaseline"; import Box from "@mui/material/Box"; import CircularProgress from "@mui/material/CircularProgress"; import Fab from "@mui/material/Fab"; +import Tooltip from "@mui/material/Tooltip"; import SmartToyIcon from "@mui/icons-material/SmartToy"; import PaletteIcon from "@mui/icons-material/Palette"; +import BugReportIcon from "@mui/icons-material/BugReport"; import SocketProvider from "./providers/SocketProvider.js"; import SocketContext from "./contexts/SocketContext.js"; @@ -136,6 +138,29 @@ const AppContent = ({ currentTheme, onThemeChange }) => { setThemeCustomizerOpen(!isThemeCustomizerOpen); }; + // Handler to open GitHub issue reporting + const handleReportIssue = () => { + const issueTitle = encodeURIComponent("Fehlerbericht"); + const issueBody = encodeURIComponent( + `**Seite:** ${window.location.href} +**Browser:** ${navigator.userAgent.split(' ')[0]} +**Datum:** ${new Date().toLocaleDateString('de-DE')} + +**Problem:** +[Beschreibe kurz das Problem] + +**So ist es passiert:** +1. +2. + +**Was sollte passieren:** +[Was erwartet wurde]` + ); + + const githubIssueUrl = `https://github.com/Growheads-de/shopFrontEnd/issues/new?title=${issueTitle}&body=${issueBody}`; + window.open(githubIssueUrl, '_blank'); + }; + // Check if we're in development mode const isDevelopment = process.env.NODE_ENV === "development"; @@ -235,35 +260,56 @@ const AppContent = ({ currentTheme, onThemeChange }) => { )} {/* Chat AI Assistant FAB */} - - - - - {/* Development-only Theme Customizer FAB */} - {isDevelopment && ( + - + + + + {/* GitHub Issue Reporter FAB */} + + + + + + + {/* Development-only Theme Customizer FAB */} + {isDevelopment && ( + + + + + )} {/* Development-only Theme Customizer Dialog */}