mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-02 12:08:37 +01:00
fix(chapters): size chapter ticks to the slider track
This commit is contained in:
@@ -131,7 +131,11 @@ export function CastPlayerProgressBar({
|
||||
thumbWidth={16}
|
||||
panHitSlop={{ top: 12, bottom: 12, left: 10, right: 10 }}
|
||||
/>
|
||||
<ChapterTicks chapters={chapters} durationMs={duration * 1000} />
|
||||
<ChapterTicks
|
||||
chapters={chapters}
|
||||
durationMs={duration * 1000}
|
||||
height={4}
|
||||
/>
|
||||
{__DEV__ && DEBUG_TOUCH_ZONES && (
|
||||
<View
|
||||
pointerEvents='none'
|
||||
|
||||
@@ -14,12 +14,15 @@ interface ChapterTicksProps {
|
||||
durationMs: number;
|
||||
/** Tick colour. */
|
||||
color?: string;
|
||||
/** Tick height in px — slightly less than the slider track thickness. */
|
||||
height?: number;
|
||||
}
|
||||
|
||||
export function ChapterTicks({
|
||||
chapters,
|
||||
durationMs,
|
||||
color = "#fff",
|
||||
height = 6,
|
||||
}: ChapterTicksProps) {
|
||||
const markers = chapterMarkers(chapters, durationMs);
|
||||
// One chapter (typically a single marker at 0) is not worth marking.
|
||||
@@ -36,8 +39,9 @@ export function ChapterTicks({
|
||||
style={{
|
||||
position: "absolute",
|
||||
left: `${marker.percent}%`,
|
||||
top: "25%",
|
||||
height: "50%",
|
||||
top: "50%",
|
||||
marginTop: -height / 2,
|
||||
height,
|
||||
width: 2,
|
||||
backgroundColor: color,
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user