-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f46f1e
commit aefe1eb
Showing
6 changed files
with
15,170 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sonar.exclusions=src/app/startups/startups.json |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import json from "./startups.json" | ||
|
||
export default function getStartups() { | ||
const { data } = json | ||
const excludedPhases = ["transfer", "alumni"] | ||
|
||
return data.reduce( | ||
(startups, startup) => { | ||
const { | ||
attributes: { phases }, | ||
} = startup | ||
|
||
if ( | ||
startup.type === "startup" && | ||
startup.relationships.incubator.data.id === "sgmas" && | ||
!phases.some((phase) => excludedPhases.includes(phase.name)) | ||
) { | ||
startups.push(startup) | ||
} | ||
|
||
return startups | ||
}, | ||
[] as typeof json.data | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Card } from "@codegouvfr/react-dsfr/Card" | ||
|
||
import getStartups from "./get-startups" | ||
|
||
export default function List() { | ||
const startups = getStartups() | ||
|
||
return ( | ||
<div className="startups-list grid grid-cols-4 gap-6"> | ||
{startups.map(({ id, attributes: { name, pitch } }) => ( | ||
<Card | ||
key={id} | ||
enlargeLink | ||
title={name} | ||
desc={pitch} | ||
linkProps={{ href: `/startups/${id}` }} | ||
imageAlt="image d'illustration de la startup" | ||
imageUrl={`https://beta.gouv.fr/img/startups/${id}.png`} | ||
/> | ||
))} | ||
</div> | ||
) | ||
} |
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,9 +1,11 @@ | ||
import { fr } from "@codegouvfr/react-dsfr" | ||
import List from "./list" | ||
|
||
export default function Startups() { | ||
return ( | ||
<section> | ||
<section className={fr.cx("fr-container", "fr-py-6w")}> | ||
<h1 className={fr.cx("fr-h1")}>Nos startups</h1> | ||
<List /> | ||
</section> | ||
) | ||
} |
Oops, something went wrong.