From 95f2e82dbbe44b4db7cb20433fc73b1851437e5c Mon Sep 17 00:00:00 2001
From: dobri1408 <50819975+dobri1408@users.noreply.github.com>
Date: Tue, 25 Jul 2023 17:38:47 +0300
Subject: [PATCH] feat: Use the new @eeacms/countup library refs - #254634
---
package.json | 6 +----
src/StatisticBlock/View.jsx | 44 ++++++++++++--------------------
src/StatisticBlock/View.test.jsx | 6 ++++-
3 files changed, 22 insertions(+), 34 deletions(-)
diff --git a/package.json b/package.json
index b102770..dc32044 100644
--- a/package.json
+++ b/package.json
@@ -17,12 +17,8 @@
"url": "git@github.com:eea/volto-statistic-block.git"
},
"addons": [],
- "resolutions": {
- "react-countup/countup.js": "2.5.0"
- },
"dependencies": {
- "react-countup": "6.3.1",
- "react-visibility-sensor": "5.1.1"
+ "@eeacms/countup": "*"
},
"devDependencies": {
"@cypress/code-coverage": "^3.10.0",
diff --git a/src/StatisticBlock/View.jsx b/src/StatisticBlock/View.jsx
index 4ea39c9..2d18fa4 100644
--- a/src/StatisticBlock/View.jsx
+++ b/src/StatisticBlock/View.jsx
@@ -2,8 +2,7 @@ import React from 'react';
import isNumber from 'lodash/isNumber';
import isNaN from 'lodash/isNaN';
import cx from 'classnames';
-import CountUp from 'react-countup';
-import VisibilitySensor from 'react-visibility-sensor';
+import { CountUp } from '@eeacms/countup';
import { Statistic } from 'semantic-ui-react';
import { UniversalLink } from '@plone/volto/components';
import {
@@ -18,25 +17,6 @@ import {
import './styles.less';
-const CountUpWrapper = ({ countUpRef, start }) => {
- const [visible, setVisible] = React.useState(false);
-
- return (
-