From f99c521adfee392df5f72212f83031a59d810205 Mon Sep 17 00:00:00 2001
From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com>
Date: Mon, 25 Sep 2023 22:20:29 +0530
Subject: [PATCH] Removed Elections counter (#219)
---
src/components/common/ProgressTracker.jsx | 84 +------------------
.../fractalVerification/TabScreens.jsx | 63 +-------------
src/pages/Activate.jsx | 20 ++---
src/utils/constants.js | 6 +-
4 files changed, 12 insertions(+), 161 deletions(-)
diff --git a/src/components/common/ProgressTracker.jsx b/src/components/common/ProgressTracker.jsx
index a3293c4..09abd84 100644
--- a/src/components/common/ProgressTracker.jsx
+++ b/src/components/common/ProgressTracker.jsx
@@ -3,21 +3,13 @@ import { wallet } from '../..';
import { getConfig } from '../../utils/config';
import { formatNumberWithComma } from '../../utils/utilityFunctions';
import { useSelector } from 'react-redux';
-import {
- ElectionsStartTime,
- IAHShutDownEndTime,
- IAHShutDownStartTime,
- Links,
- ReducerNames,
-} from '../../utils/constants';
-import moment from 'moment-timezone';
+import { Links, ReducerNames } from '../../utils/constants';
const ProgressTracker = () => {
const ProgressMeterMax = process.env.REACT_APP_PROGRESS_METER_MAX ?? 3000;
const [humansRegistered, setHumansRegistered] = useState(0);
const { showTracker } = useSelector((state) => state[ReducerNames.PROGRESS]);
const { fvToken } = useSelector((state) => state[ReducerNames.SBT]);
- const [electionStarted, setElectionStarted] = useState(false);
const fetchHumansRegistered = async () => {
try {
@@ -64,56 +56,6 @@ const ProgressTracker = () => {
const ReadableNumber = formatNumberWithComma(ProgressMeterMax);
- // Get the user's local timezone
- const userTimezone = moment.tz.guess();
- const [countdown, setCountdown] = useState({
- days: 0,
- hours: 0,
- minutes: 0,
- seconds: 0,
- });
-
- function updateCountdown() {
- const nowLocal = moment(); // Get the current local time
- const timestamp = electionStarted
- ? IAHShutDownStartTime
- : IAHShutDownEndTime;
- const futureDateLocal = timestamp.clone().tz(userTimezone);
-
- // Calculate the time remaining
- const countdownDuration = moment.duration(futureDateLocal.diff(nowLocal));
-
- setCountdown({
- days: countdownDuration.days(),
- hours: countdownDuration.hours(),
- minutes: countdownDuration.minutes(),
- seconds: countdownDuration.seconds(),
- });
- }
-
- useEffect(() => {
- const isElectionStarted = moment().isSameOrAfter(
- ElectionsStartTime.clone().tz(userTimezone)
- );
- setElectionStarted(isElectionStarted);
- updateCountdown();
-
- const interval = setInterval(updateCountdown, 1000);
-
- return () => clearInterval(interval);
- }, []);
-
- const NumberContainer = ({ number, text }) => {
- return (
-
-
- {number}
- {text}
- {electionStarted - ? 'TIME REMAINING IN CURRENT ELECTION' - : 'VOTER REGISTRATION END'} - S -
-
-