TheSurahPage.tsx: place Timer below Stream

This commit is contained in:
0x1eef 2022-10-31 15:26:18 -03:00
parent 4c0077da57
commit efd2aeed23
2 changed files with 11 additions and 8 deletions

View file

@ -21,8 +21,8 @@ export function Timer({surah, ayah, stream, setStream}: TimerProps) {
}
}, [ms]);
return (
<span className="timer">
<div className="timer">
{(ms / 1000).toFixed(1)}
</span>
</div>
);
}

View file

@ -35,16 +35,19 @@ function TheSurahPage({locale, surahId}: PageProps) {
<option value="moon">The Moon 🌛</option>
<option value="leaf">The Leaf 🌿</option>
</select>
<Timer
surah={surah}
ayah={surah.ayat[stream.length - 1]}
setStream={setStream}
stream={stream}
/>
<span></span>
</div>
}
{streamIsLoaded && <AboutSurah surah={surah}/>}
{streamIsLoaded && <Stream surah={surah} stream={stream}/>}
{streamIsLoaded && stream.length < surah.numberOfAyah &&
<Timer
surah={surah}
ayah={surah.ayat[stream.length - 1]}
setStream={setStream}
stream={stream}
/>
}
</div>
);
}