Skip to content

Commit

Permalink
feat: Update team data and add to layout
Browse files Browse the repository at this point in the history
  • Loading branch information
AnisioMandlate committed Feb 16, 2021
1 parent 4fb599d commit 826c3ca
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 21 deletions.
33 changes: 22 additions & 11 deletions .docz/app/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,17 +465,6 @@
}
]
},
{
"key": "src/components/About Card/index.jsx",
"value": [
{
"description": "",
"displayName": "AboutCards",
"methods": [],
"actualName": "AboutCards"
}
]
},
{
"key": "src/components/Button/index.jsx",
"value": [
Expand Down Expand Up @@ -607,6 +596,28 @@
"actualName": "Home"
}
]
},
{
"key": "src/pages/about-us.js",
"value": [
{
"description": "",
"displayName": "AboutUs",
"methods": [],
"actualName": "AboutUs"
}
]
},
{
"key": "src/components/About Card/index.jsx",
"value": [
{
"description": "",
"displayName": "AboutCards",
"methods": [],
"actualName": "AboutCards"
}
]
}
]
}
33 changes: 31 additions & 2 deletions package-lock.json

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

12 changes: 8 additions & 4 deletions src/components/About Card/index.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import React from "react"
import Img from "gatsby-image"

import styles from "./styles.module.css"

const AboutCards = ({ imageSrc, name, role }) => {
const AboutCards = ({ teamMember }) => {
return (
<div className={styles.card}>
<img src={imageSrc} alt={`Foto do ${name}`} className={styles.image} />
<h3 className={styles["card-title"]}>{name}</h3>
<p className={styles["card-subtitle"]}>{role}</p>
<Img
fixed={teamMember.image.childImageSharp.fixed}
className={styles.image}
/>
<h3 className={styles["card-title"]}>{teamMember.name}</h3>
<p className={styles["card-subtitle"]}>{teamMember.role}</p>
</div>
)
}
Expand Down
6 changes: 6 additions & 0 deletions src/components/Team/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.cardsHolder {
margin-top: 20px;
display: grid;
gap: 16px;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}
42 changes: 42 additions & 0 deletions src/components/Team/team.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from "react"
import { useStaticQuery, graphql } from "gatsby"

import styles from "./styles.module.css"
import AboutCards from "../About Card"

const Team = () => {
const teamQuery = graphql`
query {
allTeamYaml {
edges {
name
role
image {
childImageSharp {
fixed(width: 100) {
...GatsbyImageSharpFixed_tracedSVG
}
}
}
}
}
}
`

const {
allTeamYaml: { edges },
} = useStaticQuery(teamQuery)

return (
<div className={styles.cardsHolder}>
{edges.map((teamMember, key) => {
return <AboutCards key={key} teamMember={teamMember.node} />
})}
{/* <AboutCards
imageSrc={image}
name="Anisio Mandlate"
role="Software developer"
/> */}
</div>
)
}
4 changes: 2 additions & 2 deletions src/pages/about-us.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const AboutUs = () => (

<section className={styles.team}>
<h1>The Team</h1>
<div className={styles.cardsHolder}>
{/* <div className={styles.cardsHolder}>
<AboutCards
imageSrc={image}
name="Anisio Mandlate"
Expand All @@ -56,7 +56,7 @@ const AboutUs = () => (
name="Anisio Mandlate"
role="Software developer"
/>
</div>
</div> */}
</section>
</Layout>
)
Expand Down
4 changes: 2 additions & 2 deletions src/styles/about-us.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
text-align: center;
}

.cardsHolder {
/* .cardsHolder {
margin-top: 20px;
display: grid;
gap: 16px;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}
} */

0 comments on commit 826c3ca

Please sign in to comment.