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]); }, [ms]);
return ( return (
<span className="timer"> <div className="timer">
{(ms / 1000).toFixed(1)} {(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="moon">The Moon 🌛</option>
<option value="leaf">The Leaf 🌿</option> <option value="leaf">The Leaf 🌿</option>
</select> </select>
<Timer <span></span>
surah={surah}
ayah={surah.ayat[stream.length - 1]}
setStream={setStream}
stream={stream}
/>
</div> </div>
} }
{streamIsLoaded && <AboutSurah surah={surah}/>} {streamIsLoaded && <AboutSurah surah={surah}/>}
{streamIsLoaded && <Stream surah={surah} stream={stream}/>} {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> </div>
); );
} }