Skip to content

Commit

Permalink
add add null renderData attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
jerem1508 committed Oct 22, 2024
1 parent 88c22a1 commit b2a98a2
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,7 @@ function MenuModal({
);
}

export default function ChartWrapper({
id,
options,
legend,
renderData,
}: {
id: string;
options: Highcharts.Options;
legend: React.ReactNode;
renderData?: (options: Highcharts.Options) => React.ReactNode;
}) {
export default function ChartWrapper({ id, options, legend, renderData }) {
const [isOpen, setIsOpen] = useState(false);
const [isOpenIntegration, setIsOpenIntegration] = useState(false);
const [displayType, setDisplayType] = useState("chart"); // ["chart", "data"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default function FundedObjectives() {
))}
</ul>
}
renderData={() => null} // TODO: add data table
/>
);
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { getColorByPillierName } from "./utils";

export default function Options(data) {
if (!data) return null;

return {
chart: {
type: "bar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default function MainBeneficiaries() {
id="mainBeneficiaries"
options={options(data)}
legend={null}
renderData={() => null} // TODO: add data table
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default function FundingRanking({ indicateurId }) {
"FundingRanking"
)}
options={optionsChart(prepareData(data, sortIndicateur))}
renderData={() => null} // TODO: add data table
/>
</Col>
<Col>
Expand All @@ -77,6 +78,7 @@ export default function FundingRanking({ indicateurId }) {
"FundingRankingRates"
)}
options={optionChartSuccess(prepareData(data, sortIndicateur))}
renderData={() => null} // TODO: add data table
/>
</Col>
</Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function Top10Beneficiaries() {
"Top10Beneficiaries"
)}
options={options(data, searchParams.get("country_code") ?? null)}
renderData={() => null} // TODO: add data table
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,19 @@ export default function ProjectsTypesPillarsSubsidiesRequested({
<Container fluid>
<Row>
<Col md={6}>
<ChartWrapper id={indicateurId} options={options} legend={null} />
<ChartWrapper
id={indicateurId}
options={options}
legend={null}
renderData={() => null} // TODO: add data table
/>
</Col>
<Col>
<ChartWrapper
id={`${indicateurId}Rates`}
options={optionsRates}
legend={null}
renderData={() => null} // TODO: add data table
/>
</Col>
</Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default function SuccessRateAndEvolutionByPillar({ indicateurId }) {
</li>
</ul>
}
renderData={() => null} // TODO: add data table
/>
</Col>
</Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export default function SuccessRateForAmountsByTypeOfFinancing() {
</li>
</ul>
}
renderData={() => null} // TODO: add data table
/>
</Col>
</Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ export default function TypeOfFinancingSubsidiesRequestedByProjects() {
</li>
</ul>
}
renderData={() => null} // TODO: add data table
/>
</Col>
<Col>
<ChartWrapper
id="typeOfFinancingSubsidiesRequestedByProjectsRates"
options={optionsSubventionsRates(data)}
legend={null}
renderData={() => null} // TODO: add data table
/>
</Col>
</Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ export default function TypeOfFinancingSubsidiesRequestedLines() {
id="typeOfFinancingSubsidiesRequested"
options={optionsValues(data)}
legend={null}
renderData={() => null} // TODO: add data table
/>
</Col>
<Col>
<ChartWrapper
id="typeOfFinancingSubsidiesRequestedRates"
options={optionsRates(data)}
legend={null}
renderData={() => null} // TODO: add data table
/>
</Col>
</Row>
Expand Down

0 comments on commit b2a98a2

Please sign in to comment.