Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Fixed errors on routes [/, /courses, /events, /campusLeaders] #99

Open
wants to merge 2 commits into
base: development
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
1 change: 1 addition & 0 deletions src/layouts/MainLayout/TopBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function TopBar({ className, onMobileNavOpen, ...rest }) {
<Box ml={2} flexGrow={1} />
{navItems.map((item, index) => (
<Item
key={index}
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Each child in a list should have a unique "key" prop.

active={item.link === pathname}
title={item.title}
link={item.link}
Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/CLView/Apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Apply({ className, ...rest }) {
}}
{...rest}
>
<Grid container maxWidth="lg">
Copy link
Contributor

Choose a reason for hiding this comment

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

why this?

Copy link
Contributor

Choose a reason for hiding this comment

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

change it to maxwidth

<Grid container maxwidth="lg">
<Grid item lg={9} md={12} sm={12} xs={12} className={classes.applyleft}>
<div className={classes.main}>
<Typography
Expand Down
8 changes: 6 additions & 2 deletions src/views/pages/CLView/ApplyNowModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,12 @@ export default function ApplyNowModal() {
errorMessages={['Please select a country code']}
fullWidth
>
{countryCodes.map(code => {
return <MenuItem value={`+${code}`}>+{code}</MenuItem>;
{countryCodes.map((code, index) => {
return (
<MenuItem key={index} value={`+${code}`}>
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Each child in a list should have a unique "key" prop.

+{code}
</MenuItem>
);
})}
</SelectValidator>
</Grid>
Expand Down
8 changes: 4 additions & 4 deletions src/views/pages/CLView/CTA.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function CTA({ className, ...rest }) {
</Hidden>

<Box className={classes.flex}>
<Grid container xs={12} sm={12}>
<Grid item container xs={12} sm={12}>
Copy link
Contributor

Choose a reason for hiding this comment

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

  • The prop xs of Grid must be used on item.

<Grid item xs={12} sm={12}>
<Button
className={classes.Button + ' ' + classes.secondaryBtn}
Expand Down Expand Up @@ -198,7 +198,7 @@ function CTA({ className, ...rest }) {
</Hidden>

<Box className={classes.flex}>
<Grid container xs={12} sm={12}>
<Grid item container xs={12} sm={12}>
Copy link
Contributor

Choose a reason for hiding this comment

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

same

<Grid item xs={12} sm={12}>
<Button
className={classes.Button + ' ' + classes.secondaryBtn}
Expand Down Expand Up @@ -260,7 +260,7 @@ function CTA({ className, ...rest }) {
</Hidden>

<Box className={classes.flex}>
<Grid container xs={12} sm={12}>
<Grid item container xs={12} sm={12}>
<Grid item xs={12} sm={12}>
<Button
className={classes.Button + ' ' + classes.secondaryBtn}
Expand All @@ -269,7 +269,7 @@ function CTA({ className, ...rest }) {
target="_blank"
size="large"
variant="outlined"
disabled="true"
disabled={true}
>
Apply Now
</Button>
Expand Down
11 changes: 7 additions & 4 deletions src/views/pages/CLView/StandFor.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,31 @@ function StandsFor({ className, ...rest }) {
<Box mt={2}>
<Typography variant="body1">
He/she shall be entusiastic about going social and build &amp;
contribute for the community<h4>- An Initiative taker</h4>
contribute for the community
</Typography>
<Typography variant="h6">- An Initiative taker</Typography>
</Box>
<Box mt={2}>
<Typography variant="body1">
A Leader shall always have a way of talking people out from
problems and leading them to do that for others too{' '}
<h4> - A Community Builder</h4>
</Typography>
<Typography variant="h6"> - A Community Builder</Typography>
</Box>
<Box mt={2}>
<Typography variant="body1">
He/she should be connecting to the resources available in
community that might help in building a better &amp; more
helpful community <h4>- A Resource Seeker</h4>
helpful community
</Typography>
<Typography variant="h6">- A Resource Seeker</Typography>
</Box>
<Box mt={2}>
<Typography variant="body1">
Most sought after value - an effort maker and giving
peronality <h4>- An Investor</h4>
Copy link
Contributor

Choose a reason for hiding this comment

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

same

peronality
</Typography>
<Typography variant="h6">- An Investor</Typography>
</Box>
</Box>
</Grid>
Expand Down
6 changes: 3 additions & 3 deletions src/views/pages/CoursesView/CTA.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function CTA({ className, ...rest }) {
</Hidden>

<Box className={classes.flex}>
<Grid container xs={12} sm={12}>
<Grid item container xs={12} sm={12}>
<Grid item xs={12} sm={12}>
<Button
className={classes.Button + ' ' + classes.primeBtn}
Expand Down Expand Up @@ -133,7 +133,7 @@ function CTA({ className, ...rest }) {
</Hidden>

<Box className={classes.flex}>
<Grid container xs={12} sm={12}>
<Grid item container xs={12} sm={12}>
<Grid item xs={12} sm={12}>
<Button
className={classes.Button + ' ' + classes.secondaryBtn}
Expand Down Expand Up @@ -174,7 +174,7 @@ function CTA({ className, ...rest }) {
</Hidden>

<Box className={classes.flex}>
<Grid container xs={12} sm={12}>
<Grid item container xs={12} sm={12}>
<Grid item xs={12} sm={12}>
<Button
className={classes.Button + ' ' + classes.secondaryBtn}
Expand Down
10 changes: 3 additions & 7 deletions src/views/pages/CoursesView/Courses.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default function Courses() {
</Typography>
</Grid>

<Grid container>
<Grid container alignItems="center">
<Grid
item
lg={12}
Expand All @@ -128,8 +128,6 @@ export default function Courses() {
xs={12}
align="center"
display="flex"
justifyContent="center"
alignItems="center"
Copy link
Contributor

Choose a reason for hiding this comment

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

  • AlignItems must be used on containers.

>
<CoursesGrid courses={foundation} />
</Grid>
Expand Down Expand Up @@ -157,7 +155,7 @@ export default function Courses() {
</Typography>
</Grid>

<Grid container>
<Grid container alignItems="center">
<Grid
item
lg={12}
Expand All @@ -166,8 +164,6 @@ export default function Courses() {
xs={12}
align="center"
display="flex"
justifyContent="center"
Copy link
Contributor

Choose a reason for hiding this comment

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

  • AlignItems must be used on containers.

alignItems="center"
>
<CoursesGrid courses={advanced} />
</Grid>
Expand All @@ -191,7 +187,7 @@ const CoursesGrid = ({ courses }) => {
return (
<Grid
item
key={course.id}
key={cname}
Copy link
Contributor

Choose a reason for hiding this comment

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

⁉️ why cname, not course.id

Copy link
Contributor Author

@aymenhamada aymenhamada Sep 27, 2020

Choose a reason for hiding this comment

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

course.id was undefined, and cname was unique

lg={4}
md={4}
sm={6}
Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/CoursesView/Hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function Hero({ className, ...rest }) {
)}
</Box>
<Box mt={2} mb={3}>
<Grid container xs={12} md={12}>
<Grid item container xs={12} md={12}>
<Grid item xs={12} md={12}>
{!!user ? (
<Typography
Expand Down
6 changes: 3 additions & 3 deletions src/views/pages/EventsView/CTA.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function CTA({ className, ...rest }) {
</Hidden>

<Box className={classes.flex}>
<Grid container xs={12} sm={12}>
<Grid item container xs={12} sm={12}>
<Grid item xs={12} sm={12}>
<Button
className={classes.Button + ' ' + classes.primeBtn}
Expand Down Expand Up @@ -133,7 +133,7 @@ function CTA({ className, ...rest }) {
</Hidden>

<Box className={classes.flex}>
<Grid container xs={12} sm={12}>
<Grid item container xs={12} sm={12}>
<Grid item xs={12} sm={12}>
<Button
className={classes.Button + ' ' + classes.secondaryBtn}
Expand Down Expand Up @@ -174,7 +174,7 @@ function CTA({ className, ...rest }) {
</Hidden>

<Box className={classes.flex}>
<Grid container xs={12} sm={12}>
<Grid item container xs={12} sm={12}>
<Grid item xs={12} sm={12}>
<Button
className={classes.Button + ' ' + classes.secondaryBtn}
Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/EventsView/Events.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function EventCards({ events, upcoming }) {
{event.domain}
</Typography>
<Typography
variant="span"
variant="caption"
display="inline"
style={{
background: '#1D006E',
Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/EventsView/Hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function Hero({ className, ...rest }) {
)}
</Box>
<Box mt={2} mb={3}>
<Grid container xs={12} md={12}>
<Grid item container xs={12} md={12}>
<Grid item xs={12} md={12}>
{!!user ? (
<Typography
Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/HomeView/AboutUs/OurTeam/Team.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function Team({ mentors, className, ...rest }) {
className={classes.teamName}
color="textPrimary"
variant="h5"
underline="never"
underline="none"
href={mentor.linkedin}
target="_blank"
>
Expand Down
6 changes: 3 additions & 3 deletions src/views/pages/HomeView/CTA.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function CTA({ className, ...rest }) {
</Hidden>

<Box className={classes.flex}>
<Grid container xs={12} sm={12}>
<Grid item container xs={12} sm={12}>
<Grid item xs={12} sm={12}>
<Button
className={classes.Button + ' ' + classes.primeBtn}
Expand Down Expand Up @@ -133,7 +133,7 @@ function CTA({ className, ...rest }) {
</Hidden>

<Box className={classes.flex}>
<Grid container xs={12} sm={12}>
<Grid item container xs={12} sm={12}>
<Grid item xs={12} sm={12}>
<Button
className={classes.Button + ' ' + classes.secondaryBtn}
Expand Down Expand Up @@ -174,7 +174,7 @@ function CTA({ className, ...rest }) {
</Hidden>

<Box className={classes.flex}>
<Grid container xs={12} sm={12}>
<Grid item container xs={12} sm={12}>
<Grid item xs={12} sm={12}>
<Button
className={classes.Button + ' ' + classes.secondaryBtn}
Expand Down
21 changes: 6 additions & 15 deletions src/views/pages/HomeView/Courses.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default function Courses() {
with a purely practical approach to learning.
</Typography>
</Grid>
<Grid container>
<Grid container alignItems="center">
<Grid
item
lg={12}
Expand All @@ -167,8 +167,6 @@ export default function Courses() {
xs={12}
align="center"
display="flex"
justifyContent="center"
alignItems="center"
Copy link
Contributor

Choose a reason for hiding this comment

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

same

>
<Tabs
value={value}
Expand All @@ -189,9 +187,7 @@ export default function Courses() {
<Typography variant="h5">
<Box fontWeight={600}>Foundation</Box>
</Typography>
<Typography variant="body2">
<Box>(Reg. Open)</Box>
</Typography>
<Typography variant="body2">(Reg. Open)</Typography>
</Fragment>
}
disableRipple={true}
Expand All @@ -203,9 +199,7 @@ export default function Courses() {
<Typography variant="h5">
<Box fontWeight={600}>Advanced</Box>
</Typography>
<Typography variant="body2">
<Box>(Reg. Open)</Box>
</Typography>
<Typography variant="body2">(Reg. Open)</Typography>
Copy link
Contributor

Choose a reason for hiding this comment

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

Box can't be put inside Typography.
: validateDOMNesting(...): <div> cannot appear as a descendant of <p>.

</Fragment>
}
disableRipple={true}
Expand All @@ -218,9 +212,7 @@ export default function Courses() {
<Typography variant="h5">
<Box fontWeight={600}>Complete</Box>
</Typography>
<Typography variant="body2">
<Box>(Launching Soon)</Box>
</Typography>
<Typography variant="body2">(Launching Soon)</Typography>
Copy link
Contributor

Choose a reason for hiding this comment

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

same

</Fragment>
}
disabled
Expand All @@ -232,13 +224,12 @@ export default function Courses() {
<GridList
className={classes.gridList}
display="flex"
alignItems="center"
cols={large ? 3 : medium ? 2.5 : small ? 1.7 : 1.2}
>
{Object.entries(foundation).map(([cname, course], index) => {
return (
<GridListTile
key={course.id}
key={cname}
style={{
height: '530px'
}}
Expand All @@ -257,7 +248,7 @@ export default function Courses() {
{Object.entries(advanced).map(([cname, course], index) => {
return (
<GridListTile
key={course.id}
key={cname}
style={{
height: '530px'
}}
Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/HomeView/Events.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function Events({ className, ...rest }) {
{event.domain}
</Typography>
<Typography
variant="span"
variant="caption"
Copy link
Contributor

Choose a reason for hiding this comment

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

span is not any variant of typography,
You could have just removed it because earlier too it was taking the default value.

display="inline"
style={{
background: '#1D006E',
Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/HomeView/Hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function Hero({ className, ...rest }) {
</Typography>
</Box>
<Box mt={4}>
<Grid container xs={12} md={12}>
<Grid item container xs={12} md={12}>
<Grid item xs={12} md={12}>
<Button
className={classes.btn}
Expand Down
2 changes: 1 addition & 1 deletion src/views/pages/common/Apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function Apply({ className, ...rest }) {
}}
{...rest}
>
<Grid container maxWidth="lg">
Copy link
Contributor

Choose a reason for hiding this comment

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

React does not recognize the maxWidth prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase maxwidth instead. If you accidentally passed it from a parent component, remove it from the DOM element.

I think it was intentionally put here, so please change maxWidth to maxwidth

<Grid container maxwidth="lg">
<Grid
item
lg={12}
Expand Down
Loading