Skip to content

Simplify the partner & client logo/info update process #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,24 @@ module.exports = {
}
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-sharp`,
options: {
defaults: {
formats: [`auto`, `webp`],
placeholder: `dominantColor`,
quality: 50,
breakpoints: [750, 1080, 1366, 1920],
backgroundColor: `transparent`,
tracedSVGOptions: {},
blurredOptions: {},
jpgOptions: {},
pngOptions: {},
webpOptions: {},
avifOptions: {},
},
},
},
{
resolve: `gatsby-plugin-manifest`,
options: {
Expand Down
5 changes: 5 additions & 0 deletions src/assets/content/partners/01_drave.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Drave développement",
"website": "https://drave.quebec/",
"logo": "01_drave.png"
}
Binary file added src/assets/content/partners/01_drave.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/content/partners/03_whynotblue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Blue Communications Inc.",
"website": "https://www.whynotblue.com/",
"logo": "03_whynotblue.png"
}
5 changes: 5 additions & 0 deletions src/assets/content/partners/04_agrimetrie.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Agrimétrie",
"website": "https://www.agrimetrie.com/",
"logo": "04_agrimetrie.png"
}
Binary file added src/assets/content/partners/04_agrimetrie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/content/partners/05_esmart.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "E-SMART Control Inc.",
"website": "https://esmartcontrol.com/",
"logo": "05_esmart.png"
}
Binary file added src/assets/content/partners/05_esmart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/content/partners/06_pipemind.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Pipemind",
"website": "https://www.pipemind.com/",
"logo": "06_pipemind.png"
}
Binary file added src/assets/content/partners/06_pipemind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/content/partners/07_laconsole.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "La Console",
"website": "https://www.laconsole.org/",
"logo": "07_laconsole.png"
}
Binary file added src/assets/content/partners/07_laconsole.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/logos/logo-dignov.png
Binary file not shown.
Binary file removed src/assets/images/logos/logo-drave.png
Binary file not shown.
Binary file removed src/assets/images/logos/logo-technolibre.png
Binary file not shown.
6 changes: 3 additions & 3 deletions src/components/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import CarouselCard from "./carousel-card";

export default function Carousel({ teamIndex, setTeamIndex, locale }) {
// Query all team member info
const { content } = useStaticQuery(graphql`{
content: allContentJson(sort: {fields: en___image___base, order: ASC}) {
const { allMembersJson } = useStaticQuery(graphql`{
allMembersJson(sort: {fields: en___image___base, order: ASC}) {
nodes {
en {
name
Expand Down Expand Up @@ -44,7 +44,7 @@ export default function Carousel({ teamIndex, setTeamIndex, locale }) {
}
}`);

const members = content.nodes
const members = allMembersJson.nodes
const membersLocalized = members.map(member => member[locale])

return (
Expand Down
84 changes: 47 additions & 37 deletions src/components/logo-garden.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,41 @@ import { Trans } from 'gatsby-plugin-react-i18next';

export default function LogoGarden() {
// query all partnerlogos
const data = useStaticQuery(graphql`{
allFile(filter: {absolutePath: {regex: "/logos/"}}) {
edges {
node {
base
const { allPartnersJson } = useStaticQuery(graphql`{
allPartnersJson(sort: {fields: logo___base, order: ASC}) {
nodes {
id
name
website
logo {
childImageSharp {
gatsbyImageData(
width: 150,
placeholder: BLURRED,
layout: CONSTRAINED
width: 120,
height: 60,
placeholder: TRACED_SVG,
layout: CONSTRAINED,
transformOptions: {fit: CONTAIN, grayscale: true}
)
id
}
}
}
}
}`);
const logos = data.allFile.edges;

return (
<LogoGardenStyles>
<SiteBorderStyles>
<p className="text-center">
<Trans>Trusted by these partners and clients</Trans>
</p>
<div className="logos">
{logos.map(({node}) => (
<GatsbyImage
width={150}
image={node.childImageSharp.gatsbyImageData}
imgStyle={{ width: `auto`, height: `auto`, top: `50%`, left: `50%`, transform: `translate(-50%, -50%)`}}
className="m-4"
key={node.childImageSharp.id}
alt={node.base.split('.')[0]} />
<div className="horizontal-scroll-wrapper">
{allPartnersJson.nodes.map(partner => (
<a title={partner.name} href={partner.website} target="_blank" rel="noreferrer" key={partner.id}>
<GatsbyImage
image={partner.logo?.childImageSharp.gatsbyImageData}
imgStyle={{ objectFit: `contain` }}
alt={partner.name} />
</a>
))}
</div>
</SiteBorderStyles>
Expand All @@ -49,31 +51,39 @@ export default function LogoGarden() {

const LogoGardenStyles = styled.div`
background-color: var(--lightgrey);
height: 20vh;
padding: 20px 0;
p {
color: var(--darkgrey);
}
.logos {
scroll-snap-type: x mandatory;
display: grid;
grid-template-columns: repeat(4, 1fr);
margin-top: 5px;
height: 13vh;
place-items: center center;
-webkit-overflow-scrolling: touch;
> div {
padding-top: 1rem;
padding-bottom: 1rem;
height: 20vh;
}
.horizontal-scroll-wrapper {
height: 100%;
max-width: unset;
overflow-x: scroll;
overflow-y: hidden;
/* Hide scrollbar for IE, Edge and Firefox */
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
& > * {
scroll-snap-align: start;
min-width: 150px;
}
/* Hide scrollbar for Chrome, Safari and Opera */
white-space: nowrap;
-ms-overflow-style: none;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
> a {
display: inline-table;
height: 100%;
padding: 0 1rem;
> div {
display: table-cell;
vertical-align: middle;
}
}
@media (min-width: 1024px) {
> a {
margin: 0 1rem;
}
margin: 0 auto;
}
}
`;
6 changes: 3 additions & 3 deletions src/components/stacked-avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { GatsbyImage } from "gatsby-plugin-image";

export default function StackedAvatar({ sectionRefs, setTeamIndex, pausedRef }) {
// Query all team name and image sorted by image file name
const { content } = useStaticQuery(graphql`{
content: allContentJson(sort: {fields: en___image___base, order: ASC}) {
const { allMembersJson } = useStaticQuery(graphql`{
allMembersJson(sort: {fields: en___image___base, order: ASC}) {
nodes {
en {
name
Expand Down Expand Up @@ -44,7 +44,7 @@ export default function StackedAvatar({ sectionRefs, setTeamIndex, pausedRef })
}, 25);
}

const members = content.nodes.map(member => member.en)
const members = allMembersJson.nodes.map(member => member.en)

return (
<div className="py-8 flex">
Expand Down
1 change: 0 additions & 1 deletion src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export default function IndexPage({ pageContext }) {
}
}

// const [step, setStep] = useState(0)
useEffect(() => {
// initialize Animation on Scroll
AOS.init({ offset: 50 });
Expand Down