diff --git a/src/components/dashboard/MainMenu.tsx b/src/components/dashboard/MainMenu.tsx index 395b4c9d..dcf328c1 100644 --- a/src/components/dashboard/MainMenu.tsx +++ b/src/components/dashboard/MainMenu.tsx @@ -3,9 +3,10 @@ import Tabs from '@mui/material/Tabs'; import Tab from '@mui/material/Tab'; import Box from '@mui/material/Box'; import { useNavigate } from 'react-router-dom'; -import { Paper, Button, useTheme, Modal, Typography, Stack } from "@mui/material"; -import { AutoAwesome, FormatListBulleted, VpnKey, Usb, CloudQueue, Description, Favorite } from "@mui/icons-material"; +import { Paper, Button, useTheme, Modal, Typography, Stack, TextField, InputAdornment, IconButton } from "@mui/material"; // Added TextField, InputAdornment, IconButton +import { AutoAwesome, FormatListBulleted, VpnKey, Usb, CloudQueue, Description, Favorite, ContentCopy } from "@mui/icons-material"; // Added ContentCopy import { useTranslation } from 'react-i18next'; +import { useGlobalInfoStore } from "../../context/globalInfo"; interface MainMenuProps { value: string; @@ -16,15 +17,27 @@ export const MainMenu = ({ value = 'robots', handleChangeContent }: MainMenuProp const theme = useTheme(); const { t } = useTranslation(); const navigate = useNavigate(); - + const { notify } = useGlobalInfoStore(); + const [cloudModalOpen, setCloudModalOpen] = useState(false); const [sponsorModalOpen, setSponsorModalOpen] = useState(false); + const ossDiscountCode = "MAXUNOSS8"; + const handleChange = (event: React.SyntheticEvent, newValue: string) => { navigate(`/${newValue}`); handleChangeContent(newValue); }; + const copyDiscountCode = () => { + navigator.clipboard.writeText(ossDiscountCode).then(() => { + notify("success", "Discount code copied to clipboard!"); + }).catch(err => { + console.error('Failed to copy text: ', err); + notify("error", "Failed to copy discount code."); + }); + }; + const defaultcolor = theme.palette.mode === 'light' ? 'black' : 'white'; const buttonStyles = { @@ -92,9 +105,31 @@ export const MainMenu = ({ value = 'robots', handleChangeContent }: MainMenuProp Extract web data without getting blocked on Maxun Cloud. - As a thank-you, OSS users get 8% off. - @@ -109,7 +144,7 @@ export const MainMenu = ({ value = 'robots', handleChangeContent }: MainMenuProp Maxun is built by a small, full-time team. Your donations directly contribute to making it better.

- Thank you for your support! 💙 + Thank you for your support! 💙