Skip to content

Commit

Permalink
Merge branch 'hotfix/fix_numbers'
Browse files Browse the repository at this point in the history
  • Loading branch information
emile-bex committed Aug 1, 2023
2 parents ecf36e6 + 737c23f commit f3d4ae2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linkedout-front",
"version": "2.6.1",
"version": "2.6.2",
"description": "",
"main": "index.js",
"engines": {
Expand Down
11 changes: 8 additions & 3 deletions src/components/cards/NumberCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ const AnimatedNumber = ({ value }: { value: number | string }) => {
}
return (
<div style={{ minHeight: 1 }}>
{isVisible && typeof value === 'number' ? (
<CountUp duration={5} end={value} preserveValue />
{isVisible ? (
<>
{typeof value === 'number' ? (
<CountUp duration={5} end={value} preserveValue />
) : (
<>{value}</>
)}
</>
) : (
0
)}
{isVisible && typeof value !== 'number' ? <>{value}</> : 0}
</div>
);
}}
Expand Down
8 changes: 6 additions & 2 deletions src/components/partials/NumberPartial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ import { NumberGrid } from 'src/components/partials/NumberGrid';
import { Section } from 'src/components/utils';

const staticNumbers = [
{ value: 400, description: 'candidats accompagnés', animated: true },
{ value: 400, description: 'candidats accompagnés', animate: true },
{
value: '72%',
description: 'de sorties positives en 2022',
},
{ value: 700, description: "entreprises mobilisées dans l'inclusion" },
{
value: 700,
description: "entreprises mobilisées dans l'inclusion",
animate: true,
},
];

export const NumberPartial = () => {
Expand Down

0 comments on commit f3d4ae2

Please sign in to comment.