forked from ShelterTechSF/askdarcel-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from Exygy/home-page-prep
Home Page Prep
- Loading branch information
Showing
14 changed files
with
332 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,71 @@ | ||
import { HomePageSection } from "pages/HomePage/components/Section"; | ||
import React from "react"; | ||
import { CategoryCard } from "../Cards/CategoryCard"; | ||
import styles from "./CategorySection.module.scss"; | ||
|
||
const categories = [ | ||
{ | ||
label: "Arts, Culture, & Identity", | ||
icon: "fa-palette", | ||
}, | ||
{ | ||
label: "Childcare", | ||
icon: "fa-baby", | ||
}, | ||
{ | ||
label: "Education", | ||
icon: "fa-school", | ||
}, | ||
{ | ||
label: "Family Support", | ||
icon: "fa-people-roof", | ||
}, | ||
{ | ||
label: "Health & Wellness", | ||
icon: "fa-heart-pulse", | ||
}, | ||
{ | ||
label: "Sports & Recreation", | ||
icon: "fa-running", | ||
}, | ||
{ | ||
label: "Youth Workforce & Life Skills", | ||
icon: "fa-briefcase", | ||
}, | ||
{ | ||
label: "See all services", | ||
icon: "fa-arrow-right", | ||
}, | ||
]; | ||
interface Category { | ||
icon: { | ||
name: string; | ||
provider: string; | ||
}; | ||
label: string; | ||
slug: string; | ||
name: string; | ||
} | ||
|
||
/* | ||
TODO: future PR | ||
- Pull in title and description data | ||
- Remove hardcoded category data | ||
- add in background color field in sanity schema | ||
*/ | ||
interface FeaturedCategoriesSection { | ||
category: Category[]; | ||
name: string; | ||
} | ||
|
||
export interface FeaturedCategoriesData { | ||
header: string; | ||
subheader: string; | ||
backgroundColor: string; | ||
featuredCategoriesSection: FeaturedCategoriesSection[]; | ||
} | ||
|
||
interface CategorySectionProps { | ||
sectionData: FeaturedCategoriesData; | ||
} | ||
|
||
export const CategorySection = (props: CategorySectionProps) => { | ||
const { sectionData } = props; | ||
|
||
if (!sectionData) { | ||
return <div>Loading...</div>; | ||
} | ||
|
||
const { header, subheader, backgroundColor, featuredCategoriesSection } = | ||
sectionData; | ||
const featuredCategories = featuredCategoriesSection[0].category; | ||
|
||
export const CategorySection = () => { | ||
// const {sectionData} = props; | ||
// const {header, subheader, backgroundColor} = sectionData | ||
return ( | ||
// <HomePageSection title={header} description={subheader} backgroundColor={backgroundColor}> | ||
<div className={styles.categorySection}> | ||
<div className={styles.categoryCards}> | ||
{categories.map((category) => { | ||
return ( | ||
<CategoryCard | ||
key={category.label} | ||
label={category.label} | ||
icon={category.icon} | ||
/> | ||
); | ||
})} | ||
<HomePageSection | ||
title={header} | ||
description={subheader} | ||
backgroundColor={backgroundColor} | ||
> | ||
<div className={styles.categorySection}> | ||
<div className={styles.categoryCards}> | ||
{featuredCategories.map((category) => { | ||
return ( | ||
<CategoryCard | ||
key={category.label} | ||
label={category.label} | ||
slug={category.slug} | ||
icon={category.icon} | ||
/> | ||
); | ||
})} | ||
<CategoryCard | ||
key="See all services" | ||
label="See all services" | ||
slug="" | ||
icon={{ provider: "fas", name: "fa-arrow-right" }} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
// </HomePageSection> | ||
</HomePageSection> | ||
); | ||
}; |
68 changes: 14 additions & 54 deletions
68
app/components/ui/Section/OppEventCardSection.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,29 @@ | ||
@import "../../../styles/utils/_helpers.scss"; | ||
|
||
.oppEventSection { | ||
.cardsContainer { | ||
display: flex; | ||
flex-direction: column; | ||
gap: $general-spacing-xl; | ||
overflow: hidden; | ||
gap: $general-spacing-lg; | ||
width: 100%; | ||
padding: $spacing-24 $spacing-32; | ||
height: 100%; | ||
|
||
&.event { | ||
background: $color-brand-dark; | ||
} | ||
|
||
@media screen and (max-width: $break-tablet-s) { | ||
padding: $general-spacing-xl $general-spacing-md; | ||
} | ||
|
||
.oppEvent__header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
|
||
h2 { | ||
margin-bottom: $general-spacing-s; | ||
} | ||
|
||
&.event { | ||
h2, | ||
p { | ||
color: $white; | ||
} | ||
} | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
grid-template-rows: repeat(2, 1fr); | ||
|
||
@media screen and (max-width: $break-tablet-p) { | ||
gap: $general-spacing-s; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: stretch; | ||
} | ||
} | ||
|
||
.cardsContainer { | ||
display: flex; | ||
gap: $general-spacing-lg; | ||
width: 100%; | ||
height: 100%; | ||
|
||
&.event { | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
grid-template-rows: repeat(2, 1fr); | ||
|
||
@media screen and (max-width: $break-tablet-p) { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
} | ||
|
||
@media screen and (max-width: 1336px) { | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
} | ||
@media screen and (max-width: 1336px) { | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
} | ||
|
||
@media screen and (max-width: $break-tablet-p) { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
@media screen and (max-width: $break-tablet-p) { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
} |
Oops, something went wrong.