(isLockedOutProp);
+
+ useEffect(() => {
+ /**
+ * Checks if the user is locked out from making a pick
+ */
+ const checkLockout = (): void => {
+ const currentDateAndTime = new Date();
+ const day = currentDateAndTime.getUTCDay();
+ const hours = currentDateAndTime.getUTCHours();
+ if (
+ (day === 4 && hours >= 0) ||
+ (day > 4 && day < 2) ||
+ (day === 2 && hours < 12)
+ ) {
+ setLockedOut(true);
+ } else {
+ setLockedOut(false);
+ }
+ };
+
+ checkLockout();
+
+ const intervalId = setInterval(checkLockout, 60 * 60 * 1000);
+
+ return (): void => clearInterval(intervalId);
+ }, []);
+
+ return (
+
-
- {entryName}
-
-
-
-
- {isPickSet && (
-
- )}
-
-
+ {entryName}
+
+
+
+
- {!isEliminated && (
-
-
-
+ {isPickSet && (
+
)}
-
-
-
-);
+
+
+ {!isEliminated && (
+ unknown }) =>
+ isLockedOut === true && e.preventDefault()
+ }
+ size={'defaultButton'}
+ variant={isPickSet ? 'secondaryButton' : 'primaryButton'}
+ >
+ {isPickSet ? 'Change Pick' : 'Make Pick'}
+
+ )}
+
+