diff --git a/components/navigasyon.js b/components/navigasyon.js new file mode 100644 index 0000000..2b707f1 --- /dev/null +++ b/components/navigasyon.js @@ -0,0 +1,106 @@ +import React from 'react' +import PropTypes from 'prop-types' +import {useRouter} from 'next/router' + +import {makeStyles} from '@material-ui/core/styles' +import AppBar from '@material-ui/core/AppBar' +import Tabs from '@material-ui/core/Tabs' +import Tab from '@material-ui/core/Tab' +import HomeIcon from '@material-ui/icons/Home' +import PersonIcon from '@material-ui/icons/Person' +import MenuBookIcon from '@material-ui/icons/MenuBook' +import Typography from '@material-ui/core/Typography' +import Box from '@material-ui/core/Box' + +const tabRouteHref = [ + '/', + '/awtis?paj&paj=1', + '/teks' +] + +const tabRouteAs = [ + '/', + '/awtis/paj/1', + '/teks' +] + +function TabPanel(props) { + const {children, value, index, ...other} = props + + return ( + + ) +} + +TabPanel.propTypes = { + children: PropTypes.node, + index: PropTypes.any.isRequired, + value: PropTypes.any.isRequired +} + +function a11yProps(index) { + return { + id: `scrollable-force-tab-${index}`, + 'aria-controls': `scrollable-force-tabpanel-${index}` + } +} + +const useStyles = makeStyles(theme => ({ + root: { + marginBottom: 50, + flexGrow: 1, + width: '100%', + backgroundColor: theme.palette.background.paper + } +})) + +export default function Navigasyon({selectedTab}) { + const router = useRouter() + const classes = useStyles() + const [value, setValue] = React.useState(0) + + const handleChange = (event, newValue) => { + setValue(newValue) + + router.push(tabRouteHref[newValue], tabRouteAs[newValue]) + } + + return ( +
+ + + } {...a11yProps(0)} /> + } {...a11yProps(1)} /> + } {...a11yProps(2)} /> + + + + + +
+ ) +} + +Navigasyon.propTypes = { + selectedTab: PropTypes.number.isRequired +}