summaryrefslogtreecommitdiff
path: root/src/Geshem.tsx
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2022-09-01 11:18:13 +0300
committerYuval Adam <_@yuv.al>2022-09-01 11:18:13 +0300
commitea1670f6e05d22c516d364072b7dde9bf3ebb5ae (patch)
tree26399d10c52436741954315b2cf9016e86fec77c /src/Geshem.tsx
parente268ee7078e259590ccfc9e79d88bac71d7f29ca (diff)
Extract playback slots to config
Diffstat (limited to 'src/Geshem.tsx')
-rw-r--r--src/Geshem.tsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Geshem.tsx b/src/Geshem.tsx
index 5210622..6e88f19 100644
--- a/src/Geshem.tsx
+++ b/src/Geshem.tsx
@@ -5,7 +5,7 @@ import { Map } from "./Map";
import { Slider } from "./Slider";
import { DateTime } from "./Datetime";
-import { IMAGES_BASE_URL } from "./config";
+import { IMAGES_BASE_URL, PLAYBACK_HOURS, PLAYBACK_SLOTS } from "./config";
import "./Geshem.css";
import "rc-slider/assets/index.css";
@@ -25,6 +25,7 @@ interface GeshemProps {
date?: string
}
+
export function Geshem({ date }: GeshemProps) {
const [images, setImages] = useState<string[]>([]);
const [playback] = useState(
@@ -32,7 +33,7 @@ export function Geshem({ date }: GeshemProps) {
new URL(window.location.toString()).searchParams.get("history") ||
undefined
);
- const [slider, setSlider] = useState(playback ? 143 : 9);
+ const [slider, setSlider] = useState(playback ? PLAYBACK_SLOTS : 9);
useEffect(() => {
const fetchImages = async () =>
@@ -43,7 +44,7 @@ export function Geshem({ date }: GeshemProps) {
const buildPlayback = async () => {
const date = playback;
- const hours = Array.from(Array(24).keys()).map(
+ const hours = Array.from(Array(PLAYBACK_HOURS).keys()).map(
h => `${String(h).padStart(2, "0")}`
);
const minutes = Array.from(Array(6).keys()).map(