Skip to content

Commit

Permalink
Merge pull request #1 from csesoc/CHAOS-8-campaign-card
Browse files Browse the repository at this point in the history
Chaos 8 campaign card
  • Loading branch information
hayeselnut authored Dec 7, 2021
2 parents 66e7518 + 1a076d7 commit 9e7df33
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 4 deletions.
11 changes: 11 additions & 0 deletions frontend/src/components/CampaignCard/campaignCard.styled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// import { styled } from "@mui/material/styles";
// import { Typography } from "@mui/material/";

// export const BoldTitle = styled(Typography)`
// font-weight: 600;
// color: ${(props) => props.theme.palette.secondary.light};
// `;

// export const Subtitle = styled(Typography)`
// color: ${(props) => props.theme.palette.primary.light};
// `;
38 changes: 38 additions & 0 deletions frontend/src/components/CampaignCard/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React, { useState } from "react";
import PropTypes from 'prop-types';
import { Button, Card, CardContent, CardActions, CardMedia, Typography } from "@mui/material";

const CampaignCard = (props) => {
const { title, description, startDate, endDate, img } = props;

return (
<Card sx={{ maxWidth: 275 }}>
<CardMedia
component="img"
height="140"
image={img}
alt={`campaign cover for ${title}`}
/>
<CardContent>
<Typography variant="h5" component="div">
{title}
</Typography>
<Typography sx={{ mb: 1.5 }} color="text.secondary">
{`${startDate} - ${endDate}`}
</Typography>
</CardContent>
<CardActions>
<Button size="small">Apply</Button>

</CardActions>
</Card>
);
};

CampaignCard.propTypes = {
title: PropTypes.string,
description: PropTypes.string,
img: PropTypes.string,
};

export default CampaignCard;
Binary file added frontend/src/pages/home/director.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 34 additions & 4 deletions frontend/src/pages/home/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,41 @@
import { Container } from "@mui/material";
import React from "react";
import CampaignCard from "../../components/CampaignCard";

import DirectorDummy from './director.jpg';
import SubcomDummy from './subcom.jpg';

const Home = () => {
console.log("Home");
return (
<div>
<h1>Home</h1>
</div>
<Container>
<h2>Your Campaigns</h2>
<CampaignCard
title="Subcom Recruitment"
description="Join the fam"
startDate="1 Jan 2022"
endDate="1 Feb 2022"
img={SubcomDummy}
/>

<h2>Available Campaigns</h2>
<CampaignCard
title="Director Recruitment"
description="Join the fam"
startDate="1 Jan 2022"
endDate="1 Feb 2022"
img={DirectorDummy}
/>

<h2>Past Campaigns</h2>
<CampaignCard
title="Subcom Recruitment"
description="Join the fam"
startDate="1 Jan 2022"
endDate="1 Feb 2022"
img={SubcomDummy}
/>

</Container>
);
};

Expand Down
Binary file added frontend/src/pages/home/subcom.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions node_modules/.yarn-integrity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


0 comments on commit 9e7df33

Please sign in to comment.