Skip to content

Commit 75a260b

Browse files
author
Predrag
authored
Case study list (#24)
* Remove unused company logos * Fetch community case studies dynamically
1 parent 59cfa4e commit 75a260b

File tree

7 files changed

+31
-72
lines changed

7 files changed

+31
-72
lines changed

src/components/community-stats/CommunityUsersSection.js

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
11
import React from "react";
2-
// import KaggleLogo from "./KaggleLogo";
3-
import MapfreeLogo from "./MapfreeLogo";
4-
// import JpmcLogo from "./JpmcLogo";
5-
// import SparNordLogo from "./SparNordLogo";
2+
import { graphql, useStaticQuery } from "gatsby";
63

74
export default function CommunityUsersSection() {
85
const origin = typeof window !== "undefined" ? window.location.origin : "";
9-
const cards = [
10-
// {
11-
// logo: <JpmcLogo />,
12-
// title:
13-
// "JP Morgan Chase lorem ipsum dolorem lorem ipsum dolor lorem ipsum dolor dolor dolor dolor",
14-
// link: "/",
15-
// },
16-
{
17-
logo: <MapfreeLogo />,
18-
title:
19-
"MAPFRE: better detection of homeowner insurance fraud with synthetic data",
20-
link: `${origin}/community-case-studies/mapfre-better-detection-of-homeowner-insurance-fraud-with-synthetic-data`,
21-
},
22-
// {
23-
// logo: <KaggleLogo />,
24-
// title: "Kaggle releases data for 11 competitions using SDV",
25-
// link: "/",
26-
// },
27-
// {
28-
// logo: <SparNordLogo />,
29-
// title:
30-
// "Spar Nord Bank uses SDV’s multitable synthesizer to generate synthetic anti money laundering data",
31-
// link: "/",
32-
// },
33-
];
6+
7+
const data = useStaticQuery(graphql`
8+
query {
9+
allGhostPost(
10+
filter: {
11+
tags: { elemMatch: { slug: { eq: "hash-community-case-study" } } }
12+
}
13+
) {
14+
nodes {
15+
slug
16+
title
17+
excerpt
18+
feature_image
19+
}
20+
}
21+
}
22+
`);
23+
24+
const cards = data.allGhostPost.nodes.map((art) => ({
25+
slug: art.slug,
26+
logo: art.feature_image,
27+
title: art.title,
28+
description: art.excerpt,
29+
link: `${origin}/community-case-studies/${art.slug}`,
30+
}));
3431

3532
return (
3633
<div className="container w-full flex flex-col py-12 md:py-16 lg:py-24 px-4 md:px-5 lg:px-0 lg:w-[876px]">
@@ -50,7 +47,11 @@ export default function CommunityUsersSection() {
5047
}`}
5148
>
5249
<div className="flex items-center justify-center md:w-1/2">
53-
{c.logo}
50+
<img
51+
src={c.logo}
52+
alt="Logo"
53+
className="rounded-t-20 md:rounded-tr-none md:rounded-l-20 h-full"
54+
/>
5455
</div>
5556
<div
5657
className="flex flex-col md:w-1/2 gap-6 md:gap-9 pb-8 px-6 pt-6 md:pt-[38px] md:px-12 md:pb-[46px] rounded-b-20 md:rounded-bl-none md:rounded-tr-20 bg-midnight-25"

src/components/community-stats/JpmcLogo.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/components/community-stats/KaggleLogo.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/components/community-stats/SparNordLogo.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

static/jpmc-logo.png

-661 KB
Binary file not shown.

static/kaggle-logo.png

-457 KB
Binary file not shown.

static/spar-nord-logo.png

-484 KB
Binary file not shown.

0 commit comments

Comments
 (0)