Skip to content

Commit

Permalink
Home page how it works section #311 (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
taoliu12 authored Jun 21, 2023
1 parent 318a504 commit f039fa7
Show file tree
Hide file tree
Showing 10 changed files with 269 additions and 162 deletions.
1 change: 1 addition & 0 deletions client/src/assets/HowItWorks/people-flag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/src/assets/HowItWorks/people-sharing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/src/assets/HowItWorks/people-signup.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/src/assets/HowItWorks/people-working.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions client/src/components/DisplayGrids/InstructionGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ const instructionStyles = makeStyles<Theme, InstructionProps>((theme: Theme) =>
}));

type InstructionProps = {
instructionList: { title: string; body: string; image: string }[];
instructionsArray: { title: string; body: string; image: string }[];
};

function InstructionGrid(props: InstructionProps) {
const classes = instructionStyles(props);

return (
<Grid container justifyContent="space-between" className={`${classes.gridBoxes}`}>
{props.instructionList.map((instructionItem, index) => {
var text = <GridText title={instructionItem.title} body={instructionItem.body} />;
var image = <GridImage image={instructionItem.image} />;
{props.instructionsArray.map((instructions, index) => {
var text = <GridText title={instructions.title} body={instructions.body} />;
var image = <GridImage image={instructions.image} />;
return (
<React.Fragment key={`${instructionItem.title}_${index}`}>
<React.Fragment key={`${instructions.title}_${index}`}>
{/* Set order of the two jsx items - odd number rows have text first, even have image first */}
{index % 2 === 0 ? image : text}
{index % 2 === 0 ? text : image}
Expand Down
4 changes: 4 additions & 0 deletions client/src/theme/typography.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const typography = {
fontSize: '2.2rem',
fontWeight: 'bold',
},
h4: {
fontSize: '1.8rem',
fontWeight: 'bold',
},
marginBottom: 0,
};

Expand Down
2 changes: 2 additions & 0 deletions client/src/views/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import BannerSection from '../components/BannerSection';
import NeedsCarousel from '../components/NeedsCarousel';
import DonationsCarousel from '../components/DonationsCarousel';
import FAQs from '../components/FAQs';
import HowItWorks from './HowItWorks';

function Home(): JSX.Element {
return (
Expand All @@ -11,6 +12,7 @@ function Home(): JSX.Element {
<BannerSection />
<NeedsCarousel label={'Recent Needs From Nonprofits'} />
<DonationsCarousel label={'Recent Offers From Users'} />
<HowItWorks />
<FAQs />
</>
);
Expand Down
Loading

0 comments on commit f039fa7

Please sign in to comment.