Skip to content

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.9.13",
Copy link
Collaborator

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

"@material-ui/icons": "^4.9.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
Expand All @@ -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"
Copy link
Collaborator

Choose a reason for hiding this comment

The 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",
Expand Down
99 changes: 93 additions & 6 deletions src/components/pages/Events.js
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';
Copy link
Collaborator

Choose a reason for hiding this comment

The 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}>
Copy link
Collaborator

Choose a reason for hiding this comment

The 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass cardData as a prop to component

</TabPanel>
</div>
);
}
Loading