Skip to content

Commit d41f5c6

Browse files
Update SmallProjectCard to adapt text depending on the current number of funders and the max possible number of them.
1 parent 9f50e7a commit d41f5c6

File tree

4 files changed

+47
-39
lines changed

4 files changed

+47
-39
lines changed

src/components/fundable/SmallProjectCard.tsx

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import styles from "./styles.module.css";
2-
import ProgressBar from "./ProgressBar";
32
import { useHistory } from "@docusaurus/router";
4-
import IconContainer from "./IconContainer";
5-
import FundersIcon from "@site/static/img/icons/Funders.svg";
6-
import DollarIcon from "@site/static/img/icons/Dollar.svg";
73
import BlueCaretIcon from "@site/static/img/icons/BlueCaret.svg";
84
import LinkToMoreInformation from "./LinkToMoreInformation";
5+
import ProgressBar from "./ProgressBar";
6+
import FundersIcon from "@site/static/img/icons/Funders.svg";
7+
import DollarIcon from "@site/static/img/icons/Dollar.svg";
98

109
export function SmallProjectCard({ project }) {
1110
const history = useHistory();
@@ -63,7 +62,7 @@ export function SmallProjectCard({ project }) {
6362
</div>
6463
</div>
6564
<div className={styles.project_information_container}>
66-
<div className="flex-full-centered">
65+
<div className="flex-full-centered">
6766
<BlueCaretIcon />
6867
</div>
6968
<div className={styles.project_information}>
@@ -72,38 +71,47 @@ export function SmallProjectCard({ project }) {
7271
</div>
7372

7473
<div className={styles.note}>Note: Costs and features can be further adapted following discussion with the funding organization</div>
75-
76-
</div>
77-
<div className={"col col--5"} style={{ backgroundColor: "rgba(217, 217, 217, 0.25" }}>
78-
<div className={styles.price_container}>
79-
<div className={styles.price}>
80-
{project.price}
81-
</div>
82-
</div>
83-
<div className={styles.indicative_price_text}>
84-
Indicative price
74+
</div>
75+
<div className={"col col--5"} style={{ backgroundColor: "rgba(217, 217, 217, 0.25" }}>
76+
<div className={styles.price_container}>
77+
<div className={styles.price}>
78+
{project.price}
8579
</div>
80+
</div>
81+
<div className={styles.indicative_price_text}>
82+
Indicative price
83+
</div>
84+
<div>
85+
<div className={styles.financed_at_text}>
86+
Financed at {project.currentFundingPercentage} %
87+
</div>
88+
<div>
89+
<ProgressBar value={project.currentFundingPercentage} color={'var(--ifm-color-secondary-s1'} />
90+
</div>
91+
<div className={styles.shareable_container}>
92+
<div><FundersIcon width="35px" height="26px" /></div>
93+
<div className={styles.shareable_text}>{project.maxNbOfFunders === 1
94+
? 'Not shareable between funders'
95+
: `Shareable between ${project.maxNbOfFunders} funders`
96+
}
97+
</div>
98+
</div>
99+
<div className={styles.shareable_container}>
100+
<div><DollarIcon width="35px" height="26px" /></div>
101+
<div className={styles.shareable_text}>
102+
{project.currentNbOfFunders === 0
103+
? 'The project is not supported yet'
104+
: `Supported by ${project.currentNbOfFunders}
105+
${project.currentNbOfFunders === 1 ? 'funder' : 'funders'}
106+
`}
107+
</div>
86108

87-
<div className={styles.financed_at_text}>
88-
Financed at {project.currentFundingPercentage} %
89-
</div>
90-
<div>
91-
<ProgressBar value={project.currentFundingPercentage} color={'var(--ifm-color-secondary-s1'} />
92-
</div>
93-
<div className={styles.shareable_container}>
94-
<div><FundersIcon width="35px" height="26px" /></div>
95-
<div className={styles.shareable_text}>Shareable between {project.maxNbOfFunders} funder(s).
96-
</div>
97-
</div>
98-
<div className={styles.shareable_container}>
99-
<div><DollarIcon width="35px" height="26px" /></div>
100-
<div className={styles.shareable_text}>Supported by {project.currentNbOfFunders} funder(s).
101-
</div>
102-
</div>
109+
</div>
103110
</div>
104111
</div>
105112
</div>
106113
</div>
114+
</div>
107115
</div >
108116
)
109117
}

src/components/fundable/projectsDetails.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const fundableProjectsDetails = {
3636
title: "Raster processing tools in JupyterGIS",
3737
pageName: "JupyterGISRasterProcessing",
3838
catchUpPhrase: "",
39-
shortDescription: "JupyterGIS currently offers a set of vector processing and conversion tools. These capabilities are powered by a GDAL WebAssembly (WASM) build running in the browser. We will work on extending support to raster processing tools using the same underlying technology",
39+
shortDescription: "JupyterGIS currently offers a set of vector processing and conversion tools. These capabilities are powered by a GDAL WebAssembly (WASM) build running in the browser. We will work on extending support to raster processing tools using the same underlying technology.",
4040
description: JupyterGISRasterProcessingMD,
4141
optionA: "This is option A",
4242
optionB: "This is option B",
@@ -54,7 +54,7 @@ export const fundableProjectsDetails = {
5454
title: "Bringing processing tools to the JupyterGIS Python API",
5555
pageName: "JupyterGISToolsForPythonAPI",
5656
catchUpPhrase: "",
57-
shortDescription: "JupyterGIS currently supports several vector processing and conversion tools, currently available only through the JupyterGIS user interface. We plan to extend these capabilities to the JupyterGIS Python API, enabling users to access the same processing tools programmatically ",
57+
shortDescription: "JupyterGIS currently supports several vector processing and conversion tools, currently available only through the JupyterGIS user interface. We plan to extend these capabilities to the JupyterGIS Python API, enabling users to access the same processing tools programmatically. ",
5858
description: JupyterGISToolsForPythonAPIMD,
5959
optionA: "This is option A",
6060
optionB: "This is option B",
@@ -92,16 +92,16 @@ export const fundableProjectsDetails = {
9292
title: "Package requests for emscripten-forge",
9393
pageName: "EmscriptenForgePackageRequests",
9494
catchUpPhrase: "",
95-
shortDescription: "Emscripten-forge is a conda package distribution specifically designed for WebAssembly. While the number of available emscripten-forge packages is growing quickly, many packages are still missing from the ecosystem. We will be working on adding new packages upon request",
95+
shortDescription: "Emscripten-forge is a conda package distribution specifically designed for WebAssembly. While the number of available emscripten-forge packages is growing quickly, many packages are still missing from the ecosystem. We will be working on adding new packages upon request.",
9696
description: EmscriptenForgePackageRequestsMD,
9797
optionA: "This is option A",
9898
optionB: "This is option B",
9999
customOption: "This is custom option",
100100
icons: [EmscriptenForgeIcon, EmptyIcon, EmptyIcon, EmptyIcon, EmptyIcon, EmptyIcon],
101101
price: "TBD",
102-
maxNbOfFunders: 3,
103-
currentNbOfFunders: 1,
104-
currentFundingPercentage: 33,
102+
maxNbOfFunders: 1,
103+
currentNbOfFunders: 0,
104+
currentFundingPercentage: 0,
105105
note: "Note: Costs and features can be further adapted following discussion with the funding organization. Open-source under relevant licenses. The funding organization will be credited in communication about the project.",
106106
repoLink: "https://github.com/mamba-org/mamba"
107107
}],

static/rss.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/rss_all.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)