-
Notifications
You must be signed in to change notification settings - Fork 2
events page updated #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"@material-ui/core": "^4.9.13", | ||
"@material-ui/icons": "^4.9.1", | ||
"@testing-library/jest-dom": "^4.2.4", | ||
"@testing-library/react": "^9.5.0", | ||
|
@@ -17,8 +18,7 @@ | |
"react-i18next": "^11.4.0", | ||
"react-router-dom": "^5.1.2", | ||
"react-scripts": "3.4.1", | ||
"react-use": "^14.2.0", | ||
"@material-ui/core": "latest" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use this version of material-ui/core |
||
"react-use": "^14.2.0" | ||
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,96 @@ | ||
import React from 'react' | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add prop-types as a dependency in package.json |
||
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 Grid from '@material-ui/core/Grid'; | ||
import Showcase from '../Showcase'; | ||
import { useWindowSize } from 'react-use'; | ||
|
||
function TabPanel(props) { | ||
const { children, value, index, ...other } = props; | ||
|
||
return ( | ||
<div | ||
role="tabpanel" | ||
hidden={value !== index} | ||
id={`simple-tabpanel-${index}`} | ||
aria-labelledby={`simple-tab-${index}`} | ||
{...other} | ||
> | ||
{value === index && ( | ||
<Grid> | ||
{children} | ||
</Grid> | ||
)} | ||
</div> | ||
); | ||
} | ||
|
||
TabPanel.propTypes = { | ||
children: PropTypes.node, | ||
index: PropTypes.any.isRequired, | ||
value: PropTypes.any.isRequired, | ||
}; | ||
|
||
function a11yProps(index) { | ||
return { | ||
id: `simple-tab-${index}`, | ||
'aria-controls': `simple-tabpanel-${index}`, | ||
}; | ||
} | ||
|
||
|
||
const useStyles = makeStyles((theme) => ({ | ||
|
||
root: { | ||
flexGrow: 1, | ||
overflowX: "hidden", | ||
}, | ||
|
||
big: { | ||
marginLeft: '5rem', | ||
}, | ||
|
||
small: { | ||
marginLeft: 0, | ||
} | ||
})); | ||
|
||
export default function Events() { | ||
return ( | ||
<div> | ||
|
||
</div> | ||
) | ||
const classes = useStyles(); | ||
const [value, setValue] = React.useState(0); | ||
console.log(value); | ||
const windowSize = useWindowSize(); | ||
const handleChange = (event, newValue) => { | ||
setValue(newValue); | ||
}; | ||
|
||
return ( | ||
<div className={classes.root}> | ||
<AppBar position="static" className={windowSize.width < 769? classes.small : classes.big}> | ||
<Tabs | ||
value={value} | ||
onChange={handleChange} | ||
aria-label="simple tabs example" | ||
variant="scrollable" | ||
scrollButtons="auto" | ||
> | ||
<Tab label="Ongoing Events" {...a11yProps(0)} /> | ||
<Tab label="Upcoming Events" {...a11yProps(1)} /> | ||
<Tab label="Past Events" {...a11yProps(2)} /> | ||
</Tabs> | ||
</AppBar> | ||
<TabPanel value={value} index={0}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each card has an unexpected background. Check that and correct the styles |
||
<Showcase/> | ||
</TabPanel> | ||
<TabPanel value={value} index={1}> | ||
<Showcase/> | ||
</TabPanel> | ||
<TabPanel value={value} index={2}> | ||
<Showcase/> | ||
Comment on lines
+86
to
+92
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pass cardData as a prop to component |
||
</TabPanel> | ||
</div> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this version should not be used