Skip to content

Commit a9ea48d

Browse files
author
Carms Ng
authored
Merge pull request #35 from coderbunker/revamp-partner
Simplify the partner & client logo/info update process
2 parents fc77674 + fc58663 commit a9ea48d

28 files changed

+101
-45
lines changed

gatsby-config.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,24 @@ module.exports = {
3939
}
4040
},
4141
`gatsby-transformer-sharp`,
42-
`gatsby-plugin-sharp`,
42+
{
43+
resolve: `gatsby-plugin-sharp`,
44+
options: {
45+
defaults: {
46+
formats: [`auto`, `webp`],
47+
placeholder: `dominantColor`,
48+
quality: 50,
49+
breakpoints: [750, 1080, 1366, 1920],
50+
backgroundColor: `transparent`,
51+
tracedSVGOptions: {},
52+
blurredOptions: {},
53+
jpgOptions: {},
54+
pngOptions: {},
55+
webpOptions: {},
56+
avifOptions: {},
57+
},
58+
},
59+
},
4360
{
4461
resolve: `gatsby-plugin-manifest`,
4562
options: {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Drave développement",
3+
"website": "https://drave.quebec/",
4+
"logo": "01_drave.png"
5+
}
11.8 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Blue Communications Inc.",
3+
"website": "https://www.whynotblue.com/",
4+
"logo": "03_whynotblue.png"
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Agrimétrie",
3+
"website": "https://www.agrimetrie.com/",
4+
"logo": "04_agrimetrie.png"
5+
}
5.06 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "E-SMART Control Inc.",
3+
"website": "https://esmartcontrol.com/",
4+
"logo": "05_esmart.png"
5+
}
5.56 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Pipemind",
3+
"website": "https://www.pipemind.com/",
4+
"logo": "06_pipemind.png"
5+
}
98.2 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "La Console",
3+
"website": "https://www.laconsole.org/",
4+
"logo": "07_laconsole.png"
5+
}
18.3 KB
Loading
-5.21 KB
Binary file not shown.
-2.47 KB
Binary file not shown.
-1.99 KB
Binary file not shown.

src/components/carousel.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import CarouselCard from "./carousel-card";
44

55
export default function Carousel({ teamIndex, setTeamIndex, locale }) {
66
// Query all team member info
7-
const { content } = useStaticQuery(graphql`{
8-
content: allContentJson(sort: {fields: en___image___base, order: ASC}) {
7+
const { allMembersJson } = useStaticQuery(graphql`{
8+
allMembersJson(sort: {fields: en___image___base, order: ASC}) {
99
nodes {
1010
en {
1111
name
@@ -44,7 +44,7 @@ export default function Carousel({ teamIndex, setTeamIndex, locale }) {
4444
}
4545
}`);
4646

47-
const members = content.nodes
47+
const members = allMembersJson.nodes
4848
const membersLocalized = members.map(member => member[locale])
4949

5050
return (

src/components/logo-garden.js

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,41 @@ import { Trans } from 'gatsby-plugin-react-i18next';
77

88
export default function LogoGarden() {
99
// query all partnerlogos
10-
const data = useStaticQuery(graphql`{
11-
allFile(filter: {absolutePath: {regex: "/logos/"}}) {
12-
edges {
13-
node {
14-
base
10+
const { allPartnersJson } = useStaticQuery(graphql`{
11+
allPartnersJson(sort: {fields: logo___base, order: ASC}) {
12+
nodes {
13+
id
14+
name
15+
website
16+
logo {
1517
childImageSharp {
1618
gatsbyImageData(
17-
width: 150,
18-
placeholder: BLURRED,
19-
layout: CONSTRAINED
19+
width: 120,
20+
height: 60,
21+
placeholder: TRACED_SVG,
22+
layout: CONSTRAINED,
23+
transformOptions: {fit: CONTAIN, grayscale: true}
2024
)
21-
id
2225
}
2326
}
2427
}
2528
}
2629
}`);
27-
const logos = data.allFile.edges;
30+
2831
return (
2932
<LogoGardenStyles>
3033
<SiteBorderStyles>
3134
<p className="text-center">
3235
<Trans>Trusted by these partners and clients</Trans>
3336
</p>
34-
<div className="logos">
35-
{logos.map(({node}) => (
36-
<GatsbyImage
37-
width={150}
38-
image={node.childImageSharp.gatsbyImageData}
39-
imgStyle={{ width: `auto`, height: `auto`, top: `50%`, left: `50%`, transform: `translate(-50%, -50%)`}}
40-
className="m-4"
41-
key={node.childImageSharp.id}
42-
alt={node.base.split('.')[0]} />
37+
<div className="horizontal-scroll-wrapper">
38+
{allPartnersJson.nodes.map(partner => (
39+
<a title={partner.name} href={partner.website} target="_blank" rel="noreferrer" key={partner.id}>
40+
<GatsbyImage
41+
image={partner.logo?.childImageSharp.gatsbyImageData}
42+
imgStyle={{ objectFit: `contain` }}
43+
alt={partner.name} />
44+
</a>
4345
))}
4446
</div>
4547
</SiteBorderStyles>
@@ -49,31 +51,39 @@ export default function LogoGarden() {
4951

5052
const LogoGardenStyles = styled.div`
5153
background-color: var(--lightgrey);
52-
height: 20vh;
53-
padding: 20px 0;
5454
p {
5555
color: var(--darkgrey);
5656
}
57-
.logos {
58-
scroll-snap-type: x mandatory;
59-
display: grid;
60-
grid-template-columns: repeat(4, 1fr);
61-
margin-top: 5px;
62-
height: 13vh;
63-
place-items: center center;
64-
-webkit-overflow-scrolling: touch;
57+
> div {
58+
padding-top: 1rem;
59+
padding-bottom: 1rem;
60+
height: 20vh;
61+
}
62+
.horizontal-scroll-wrapper {
63+
height: 100%;
64+
max-width: unset;
6565
overflow-x: scroll;
6666
overflow-y: hidden;
67-
/* Hide scrollbar for IE, Edge and Firefox */
68-
-ms-overflow-style: none; /* IE and Edge */
69-
scrollbar-width: none; /* Firefox */
70-
& > * {
71-
scroll-snap-align: start;
72-
min-width: 150px;
73-
}
74-
/* Hide scrollbar for Chrome, Safari and Opera */
67+
white-space: nowrap;
68+
-ms-overflow-style: none;
69+
scrollbar-width: none;
7570
&::-webkit-scrollbar {
7671
display: none;
7772
}
73+
> a {
74+
display: inline-table;
75+
height: 100%;
76+
padding: 0 1rem;
77+
> div {
78+
display: table-cell;
79+
vertical-align: middle;
80+
}
81+
}
82+
@media (min-width: 1024px) {
83+
> a {
84+
margin: 0 1rem;
85+
}
86+
margin: 0 auto;
87+
}
7888
}
7989
`;

src/components/stacked-avatar.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { GatsbyImage } from "gatsby-plugin-image";
44

55
export default function StackedAvatar({ sectionRefs, setTeamIndex, pausedRef }) {
66
// Query all team name and image sorted by image file name
7-
const { content } = useStaticQuery(graphql`{
8-
content: allContentJson(sort: {fields: en___image___base, order: ASC}) {
7+
const { allMembersJson } = useStaticQuery(graphql`{
8+
allMembersJson(sort: {fields: en___image___base, order: ASC}) {
99
nodes {
1010
en {
1111
name
@@ -44,7 +44,7 @@ export default function StackedAvatar({ sectionRefs, setTeamIndex, pausedRef })
4444
}, 25);
4545
}
4646

47-
const members = content.nodes.map(member => member.en)
47+
const members = allMembersJson.nodes.map(member => member.en)
4848

4949
return (
5050
<div className="py-8 flex">

src/pages/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export default function IndexPage({ pageContext }) {
3030
}
3131
}
3232

33-
// const [step, setStep] = useState(0)
3433
useEffect(() => {
3534
// initialize Animation on Scroll
3635
AOS.init({ offset: 50 });

0 commit comments

Comments
 (0)