Audit qualité : corrections de bugs, nettoyage, lint 0 erreur, tests #4
@@ -1,15 +1,11 @@
|
||||
'use client'
|
||||
|
||||
import {useState} from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import {useRouter, usePathname} from 'next/navigation'
|
||||
|
||||
import {styled} from '@mui/material/styles'
|
||||
import AppBar from '@mui/material/AppBar'
|
||||
import Tabs, {tabsClasses} from '@mui/material/Tabs'
|
||||
import Tab from '@mui/material/Tab'
|
||||
import Typography from '@mui/material/Typography'
|
||||
import Box from '@mui/material/Box'
|
||||
import {useMediaQuery} from '@mui/material'
|
||||
|
||||
import MusicNoteIcon from '@mui/icons-material/MusicNote'
|
||||
@@ -49,32 +45,6 @@ const tabPath = {
|
||||
awtis: 3,
|
||||
}
|
||||
|
||||
function TabPanel(props) {
|
||||
const {children, value, index, ...other} = props
|
||||
|
||||
return (
|
||||
<div
|
||||
role='tabpanel'
|
||||
hidden={value !== index}
|
||||
id={`scrollable-force-tabpanel-${index}`}
|
||||
aria-labelledby={`scrollable-force-tab-${index}`}
|
||||
{...other}
|
||||
>
|
||||
{value === index && (
|
||||
<Box p={3}>
|
||||
<Typography component='div'>{children}</Typography>
|
||||
</Box>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
TabPanel.propTypes = {
|
||||
children: PropTypes.node,
|
||||
index: PropTypes.any.isRequired,
|
||||
value: PropTypes.any.isRequired
|
||||
}
|
||||
|
||||
function a11yProps(index) {
|
||||
return {
|
||||
id: `scrollable-force-tab-${index}`,
|
||||
@@ -89,11 +59,8 @@ export default function Navigasyon() {
|
||||
const selectedTab = tabPath[selectedPath]
|
||||
|
||||
const isMobile = useMediaQuery('(max-width:422px)')
|
||||
const [value, setValue] = useState(0)
|
||||
|
||||
const handleChange = (event, newValue) => {
|
||||
setValue(newValue)
|
||||
|
||||
if (newValue !== selectedTab) {
|
||||
router.push(tabRouteHref[newValue])
|
||||
}
|
||||
@@ -126,10 +93,6 @@ export default function Navigasyon() {
|
||||
</Tabs>
|
||||
}
|
||||
</AppBar>
|
||||
<TabPanel value={value} index={0} />
|
||||
<TabPanel value={value} index={1} />
|
||||
<TabPanel value={value} index={2} />
|
||||
<TabPanel value={value} index={3} />
|
||||
</div>
|
||||
</Appdiv>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user