Skip to content
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

Feat/add image tutorials #4

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 0 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Codelabz</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
Expand Down
6 changes: 1 addition & 5 deletions less.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const lessOptions = {
export const lessOptions = {
lessOptions: {
javascriptEnabled: true,
modifyVars: {
Expand All @@ -10,7 +10,3 @@ const lessOptions = {
}
}
};

module.exports = {
lessOptions
};
10 changes: 5 additions & 5 deletions src/components/AuthPage/smButton/smButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ const SmButtons = () => {
}}
>
<Grid item>
<IconButton className={classes.button}>
<Icon
onClick={() => signInWithGoogle()(firebase, dispatch)}
className={classes.google}
>
<IconButton
className={classes.button}
onClick={() => signInWithGoogle()(firebase, dispatch)}
>
<Icon className={classes.google}>
<img className={classes.imageIcon} src={GoogleImg} alt="google" />
</Icon>
</IconButton>
Expand Down
12 changes: 6 additions & 6 deletions src/components/CardTabs/Events/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ const EventsCard = props => {
<div className={classes.root}>
<Card
className={(classes.card, classes.root)}
data-testId="upcomingEventCard"
data-testid="upcomingEventCard"
>
<CardContent
style={{
width: "100%"
}}
>
<Typography variant="h5" component="div" gutterBottom>
<Typography variant="h5" component="div" gutterbottom="true">
{props.title}
</Typography>
{props.events.map(function (event, index) {
Expand All @@ -54,23 +54,23 @@ const EventsCard = props => {
container
direction="row"
spacing={2}
data-testId={index == 0 ? "upEventBox" : ""}
data-testid={index == 0 ? "upEventBox" : ""}
>
<Grid item xs={3}>
<img
src={event.img[0]}
className={classes.logo}
data-testId={index == 0 ? "upEventImg" : ""}
data-testid={index == 0 ? "upEventImg" : ""}
/>
</Grid>

<Grid item xs={9}>
<Box data-testId={index == 0 ? "upEventName" : ""}>
<Box data-testid={index == 0 ? "upEventName" : ""}>
<Typography>{event.name}</Typography>
</Box>
<Box
sx={{ fontWeight: 400, fontSize: "0.8rem" }}
data-testId={index == 0 ? "upEventDate" : ""}
data-testid={index == 0 ? "upEventDate" : ""}
>
<Typography>{event.date}</Typography>
</Box>
Expand Down
6 changes: 3 additions & 3 deletions src/components/CardTabs/Tags/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ const TagCard = props => {
const classes = useStyles();

return (
<div className={classes.root} data-testId="TagsCard">
<div className={classes.root} data-testid="TagsCard">
<Card sx={{ minWidth: 275 }}>
<CardContent>
<Typography
variant="h6"
component="div"
gutterBottom
data-testId="TagsCardTitle"
data-testid="TagsCardTitle"
>
Popular Tags
</Typography>
Expand All @@ -61,7 +61,7 @@ const TagCard = props => {
label={tag}
id={index}
className={classes.chip}
data-testId={index === 0 ? "TagsChip" : ""}
data-testid={index === 0 ? "TagsChip" : ""}
/>
);
})}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CardTabs/Users/UserElement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const UserElement = ({ user, index, useStyles }) => {
key: "user" + { index },
mb: 1.5
}}
gutterBottom
gutterbottom="true"
>
<Box
sx={{
Expand Down
82 changes: 61 additions & 21 deletions src/components/HomePage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,20 @@ function HomePage({ background = "white", textColor = "black" }) {
<Card
className={classes.wrapper}
style={{ background: background }}
data-testId="homepage"
data-testid="homepage"
>
<Grid container justifyContent="center" className={classes.contentPart}>
<Grid item xs={2} className={classes.sideBody}>
{/* <Grid container item={windowSize.width > 750 ? true : undefined} xs={2} className={classes.sideBody}> */}
<Grid
container
item={windowSize.width > 750 ? true : undefined}
xs={windowSize.width > 750 ? 2 : undefined}
className={classes.sideBody}
>
{windowSize.width > 750 && (
<Grid
item
container
item={windowSize.width > 750 ? true : undefined}
className={classes.leftSideCard}
direction="column"
style={{
Expand All @@ -216,17 +222,22 @@ function HomePage({ background = "white", textColor = "black" }) {
boxShadow: "none"
}}
>
<Grid item className={classes.outerSideBar}>
<Grid
container
item={windowSize.width > 750 ? true : undefined}
className={classes.outerSideBar}
>
<SideBar open={openMenu} toggleSlider={toggleSlider} />
</Grid>
</Grid>
)}
</Grid>
<Grid
item
container
item={windowSize.width > 750 ? true : undefined}
className={classes.mainBody}
data-testId="homepageMainBody"
xs={6}
data-testid="homepageMainBody"
xs={windowSize.width > 750 ? 6 : undefined}
>
<NewCodelabz setVisibleModal={setVisibleModal} />
<NewTutorial
Expand All @@ -236,7 +247,11 @@ function HomePage({ background = "white", textColor = "black" }) {
<Card className={classes.card}>
<Activity />
</Card>
<Box item sx={{ display: { md: "none" } }}>
<Box
container
item={windowSize.width > 750 ? true : undefined}
sx={{ display: { md: "none" } }}
>
<TagCard tags={tags} />
</Box>
{tutorials.map(tutorial => {
Expand All @@ -257,7 +272,7 @@ function HomePage({ background = "white", textColor = "black" }) {
<Tabs
value={selectedTab}
onChange={handleTabChange}
scrollButtons="on"
scrollButtons="auto"
indicatorColor="primary"
textColor="primary"
aria-label="scrollable force tabs example"
Expand Down Expand Up @@ -303,18 +318,27 @@ function HomePage({ background = "white", textColor = "black" }) {
</Box>
</Grid>

<Grid item className={classes.sideBody} xs={3}>
<Grid
container
item={windowSize.width > 750 ? true : undefined}
className={classes.sideBody}
xs={windowSize.width > 750 ? 3 : undefined}
>
<Grid
item
container
item={windowSize.width > 750 ? true : undefined}
alignContent="center"
direction="column"
style={{
width: "100%"
}}
data-testId="homepageTagSidebar"
data-testid="homepageTagSidebar"
>
<Grid item style={{ minWidth: "100%" }}>
<Grid
container
item={windowSize.width > 750 ? true : undefined}
style={{ minWidth: "100%" }}
>
<TagCard tags={tags} />
</Grid>
</Grid>
Expand All @@ -325,9 +349,13 @@ function HomePage({ background = "white", textColor = "black" }) {
style={{
width: "100%"
}}
data-testId="homepageUpcomingEvents"
data-testid="homepageUpcomingEvents"
>
<Grid item style={{ minWidth: "100%" }}>
<Grid
container
item={windowSize.width > 750 ? true : undefined}
style={{ minWidth: "100%" }}
>
<EventsCard title={"Upcoming Events"} events={upcomingEvents} />
</Grid>
</Grid>
Expand All @@ -338,9 +366,13 @@ function HomePage({ background = "white", textColor = "black" }) {
style={{
width: "100%"
}}
data-testId="homepageUsersToFollow"
data-testid="homepageUsersToFollow"
>
<Grid item style={{ minWidth: "100%" }}>
<Grid
container
item={windowSize.width > 750 ? true : undefined}
style={{ minWidth: "100%" }}
>
<UserCard title={"Who to Follow"} users={usersToFollow} />
</Grid>
</Grid>
Expand All @@ -356,9 +388,13 @@ function HomePage({ background = "white", textColor = "black" }) {
border: "none",
boxShadow: "none"
}}
data-testId="homepageContributors"
data-testid="homepageContributors"
>
<Grid item style={{ minWidth: "100%" }}>
<Grid
container
item={windowSize.width > 750 ? true : undefined}
style={{ minWidth: "100%" }}
>
<UserCard title={"Contributors"} users={contributors} />
</Grid>
</Grid>
Expand All @@ -370,9 +406,13 @@ function HomePage({ background = "white", textColor = "black" }) {
style={{
width: "100%"
}}
data-testId="homepagePopularEventSidebar"
data-testid="homepagePopularEventSidebar"
>
<Grid item style={{ minWidth: "100%" }}>
<Grid
container
item={windowSize.width > 750 ? true : undefined}
style={{ minWidth: "100%" }}
>
<EventsCard title={"Popular Events"} events={upcomingEvents} />
</Grid>
</Grid>
Expand Down
13 changes: 6 additions & 7 deletions src/components/NavBar/new/MiniNavbar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,12 @@ function MiniNavbar() {
<BrandName />
</Grid>
<Grid item className={classes.hamburger}>
<IconButton>
{window.innerWidth > 960 && (
<MenuIcon onClick={() => toggleDrawer(true)} />
)}
{window.innerWidth <= 960 && (
<MenuIcon onClick={() => toggleSlider()} />
)}
<IconButton
onClick={() =>
window.innerWidth > 960 ? toggleDrawer(true) : toggleSlider()
}
>
<MenuIcon />
</IconButton>
</Grid>
</Grid>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideBar/sidelist.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const SideList = ({
{menuItems.map(function (item, index) {
return (
<div
key="menu-items"
key={`menu-item-${index}`}
style={
item.link == location.pathname
? { background: "#d9f1fc", borderRadius: "100px" }
Expand Down
2 changes: 1 addition & 1 deletion src/components/Topbar/Activity/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function Activity() {

return (
<React.Fragment>
<Grid container data-testId="activityCard">
<Grid container data-testid="activityCard">
<div className={classes.root}>
<Grid item>
<Typography variant="h6">Activity</Typography>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Topbar/NewCodelabz/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ function NewCodelabz({ setVisibleModal }) {

return (
<React.Fragment>
<Paper className={classes.root} data-testId="homepageNewCodelabz">
<Paper className={classes.root} data-testid="homepageNewCodelabz">
<Grid
spacing={0}
container spacing={0}
justifyContent="flex-start"
alignItems="center"
className={classes.flex}
Expand All @@ -46,7 +46,7 @@ function NewCodelabz({ setVisibleModal }) {
className={classes.iconDiv}
justifyContent="center"
alignContent="center"
data-testId="NewCodelabzBtn"
data-testid="NewCodelabzBtn"
onClick={() => setVisibleModal(true)}
>
<AddBoxRoundedIcon color="primary" fontSize="large" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import React from "react";
import { Link } from "react-router-dom";

const TutorialCard = ({
tutorialData: { tutorial_id, title, summary, icon, owner },
tutorialData: { tutorial_id, title, summary, featured_image, owner },
loading
}) => {
return (
Expand All @@ -22,7 +22,7 @@ const TutorialCard = ({
component="img"
alt="Tutorial icon"
height="140"
image={icon ? icon : TutorialImg}
image={featured_image ? featured_image : TutorialImg}
title="Tutorial icon"
/>

Expand Down
Loading
Loading