fix: episode slider

This commit is contained in:
Kentai Radiquum 2024-11-22 02:33:48 +05:00
parent 03ef38be92
commit b2149b39cb
Signed by: Radiquum
GPG key ID: 858E8EE696525EED

View file

@ -263,23 +263,28 @@ export const ReleasePlayer = (props: { id: number }) => {
direction={"horizontal"} direction={"horizontal"}
mousewheel={{ mousewheel={{
enabled: true, enabled: true,
sensitivity: 2 sensitivity: 2,
}} }}
scrollbar={true} scrollbar={true}
allowTouchMove={true} allowTouchMove={true}
style={{ style={
"--swiper-scrollbar-bottom": "0", {
} as React.CSSProperties} "--swiper-scrollbar-bottom": "0",
} as React.CSSProperties
}
> >
{episodeInfo.map((episode: any) => ( {episodeInfo.map((episode: any) => (
<SwiperSlide key={`episode_${episode.position}`} style={{maxWidth: "fit-content"}}> <SwiperSlide
key={`episode_${episode.position}`}
style={{ maxWidth: "fit-content" }}
>
<Button <Button
color={ color={
selectedEpisode.position === episode.position selectedEpisode.position === episode.position
? "blue" ? "blue"
: "light" : "light"
} }
theme={{ base: "w-fit disabled:opacity-100" }} theme={{ base: "w-full disabled:opacity-100" }}
onClick={() => { onClick={() => {
setSelectedEpisode(episode); setSelectedEpisode(episode);
episode.is_watched = true; episode.is_watched = true;
@ -300,14 +305,16 @@ export const ReleasePlayer = (props: { id: number }) => {
? episode.position ? episode.position
: episode.position + 1 : episode.position + 1
} серия`} } серия`}
{(episode.is_watched || {episode.is_watched ||
getAnonCurrentEpisodeWatched( getAnonCurrentEpisodeWatched(
props.id, props.id,
selectedSource.id, selectedSource.id,
selectedVoiceover.id, selectedVoiceover.id,
episode.position episode.position
)) && ( ) ? (
<span className="w-5 h-5 ml-2 iconify material-symbols--check-circle"></span> <span className="w-5 h-5 ml-2 iconify material-symbols--check-circle"></span>
) : (
<span className="w-5 h-5 ml-2 opacity-10 iconify material-symbols--check-circle"></span>
)} )}
</Button> </Button>
</SwiperSlide> </SwiperSlide>