-
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
3dd810c
commit e13e74d
Showing
20 changed files
with
98 additions
and
76 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
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
This file was deleted.
Oops, something went wrong.
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
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
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
File renamed without changes.
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
File renamed without changes.
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 @@ | ||
export default function Filters({ | ||
selectedPhase, | ||
onClick, | ||
}: { | ||
selectedPhase?: string | ||
onClick: (phase: string) => void | ||
}) { | ||
const phases = ["investigation", "construction", "acceleration", "success"] | ||
|
||
return ( | ||
<div className="filters flex"> | ||
{phases.map((phase, i) => ( | ||
<div className="filter flex" key={`phase-filter-${phase}`}> | ||
<div | ||
onClick={() => onClick(phase)} | ||
className={selectedPhase === phase ? "selected text-red-700" : ""} | ||
> | ||
{phase} | ||
</div> | ||
{i < phases.length - 1 && <> | </>} | ||
</div> | ||
))} | ||
</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,14 +1,34 @@ | ||
"use client" | ||
|
||
import { useState } from "react" | ||
|
||
import Item from "./item" | ||
import getStartups from "../../app/startups/get-startups" | ||
import Filters from "./filters" | ||
import getStartups from "@/utils/get-startups" | ||
|
||
export default function StartupsList() { | ||
const startups = getStartups() | ||
const [selectedPhase, setSelectedPhase] = useState<string>() | ||
|
||
function handleClick(phase: string) { | ||
setSelectedPhase(phase) | ||
} | ||
|
||
const filteredStartups = selectedPhase | ||
? startups.filter( | ||
(startup) => | ||
startup.attributes.phases.slice(-1).pop()?.name === selectedPhase | ||
) | ||
: startups | ||
|
||
return ( | ||
<div className="startups-list grid grid-cols-4 gap-6 fr-mt-6w"> | ||
{startups.map((startup) => ( | ||
<Item key={startup.id} startup={startup} /> | ||
))} | ||
<div className="startups"> | ||
<Filters onClick={handleClick} selectedPhase={selectedPhase} /> | ||
<div className="startups-list grid grid-cols-4 gap-6 fr-mt-6w"> | ||
{filteredStartups.map((startup) => ( | ||
<Item key={startup.id} startup={startup} /> | ||
))} | ||
</div> | ||
</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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/app/startups/[id]/get-organisation.ts → src/utils/get-organisation.ts
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
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