color switches to pink when tab is selected

This commit is contained in:
amit
2024-11-07 10:43:13 +05:30
parent f4a0327c9a
commit a486e66ee5

View File

@@ -17,6 +17,10 @@ export const MainMenu = ({ value = 'recordings', handleChangeContent }: MainMenu
handleChangeContent(newValue); handleChangeContent(newValue);
}; };
// Define colors based on theme mode
const defaultcolor = theme.palette.mode === 'light' ? 'black' : 'white';
const selectedPink = '#FF00C3';
return ( return (
<Paper <Paper
sx={{ sx={{
@@ -24,7 +28,7 @@ export const MainMenu = ({ value = 'recordings', handleChangeContent }: MainMenu
width: '250px', width: '250px',
backgroundColor: theme.palette.background.paper, backgroundColor: theme.palette.background.paper,
paddingTop: '0.5rem', paddingTop: '0.5rem',
color: theme.palette.text.primary, color: defaultcolor,
}} }}
variant="outlined" variant="outlined"
square square
@@ -33,34 +37,40 @@ export const MainMenu = ({ value = 'recordings', handleChangeContent }: MainMenu
<Tabs <Tabs
value={value} value={value}
onChange={handleChange} onChange={handleChange}
textColor="primary"
indicatorColor="primary"
orientation="vertical" orientation="vertical"
sx={{ alignItems: 'flex-start' }} sx={{
alignItems: 'flex-start',
'& .MuiTab-root': {
color: defaultcolor,
textTransform: 'none', // Non-capitalized text
fontSize: 'medium',
justifyContent: 'flex-start',
textAlign: 'left',
'&.Mui-selected': {
color: selectedPink, // Darker pink for selected tab
},
},
}}
> >
<Tab <Tab
sx={{ justifyContent: 'flex-start', textAlign: 'left', fontSize: 'medium', color: theme.palette.text.primary }}
value="recordings" value="recordings"
label="Robots" label="Robots"
icon={<AutoAwesome />} icon={<AutoAwesome />}
iconPosition="start" iconPosition="start"
/> />
<Tab <Tab
sx={{ justifyContent: 'flex-start', textAlign: 'left', fontSize: 'medium', color: theme.palette.text.primary }}
value="runs" value="runs"
label="Runs" label="Runs"
icon={<FormatListBulleted />} icon={<FormatListBulleted />}
iconPosition="start" iconPosition="start"
/> />
<Tab <Tab
sx={{ justifyContent: 'flex-start', textAlign: 'left', fontSize: 'medium', color: theme.palette.text.primary }}
value="proxy" value="proxy"
label="Proxy" label="Proxy"
icon={<Usb />} icon={<Usb />}
iconPosition="start" iconPosition="start"
/> />
<Tab <Tab
sx={{ justifyContent: 'flex-start', textAlign: 'left', fontSize: 'medium', color: theme.palette.text.primary }}
value="apikey" value="apikey"
label="API Key" label="API Key"
icon={<VpnKey />} icon={<VpnKey />}