chore(media): address requested changes

This commit is contained in:
Elian Doran 2026-03-11 21:26:24 +02:00
parent 906889a035
commit 634ab5b5c0
No known key found for this signature in database
5 changed files with 7 additions and 6 deletions

View File

@ -8,6 +8,7 @@
color: var(--muted-text-color);
height: 100%;
text-align: center;
white-space: pre-line;
.tn-icon {
font-size: 4em;

View File

@ -21,7 +21,7 @@ export default function AudioPreview({ note }: { note: FNote }) {
audio.pause();
}
}, []);
const onKeyDown = useKeyboardShortcuts(audioRef, wrapperRef, togglePlayback);
const onKeyDown = useKeyboardShortcuts(audioRef, togglePlayback);
useEffect(() => setError(false), [note.noteId]);
const onError = useCallback(() => setError(true), []);
@ -68,7 +68,7 @@ export default function AudioPreview({ note }: { note: FNote }) {
);
}
function useKeyboardShortcuts(audioRef: MutableRef<HTMLAudioElement | null>, wrapperRef: MutableRef<HTMLDivElement | null>, togglePlayback: () => void) {
function useKeyboardShortcuts(audioRef: MutableRef<HTMLAudioElement | null>, togglePlayback: () => void) {
return useCallback((e: KeyboardEvent) => {
const audio = audioRef.current;
if (!audio) return;

View File

@ -1,8 +1,8 @@
.media-preview-controls {
.media-preview-controls {
padding: 1.25em;
display: flex;
flex-direction: column;
gap: 0.5em;
gap: 0.5em;
.media-buttons-row {
display: flex;

View File

@ -74,7 +74,7 @@ export function VolumeControl({ mediaRef }: { mediaRef: RefObject<HTMLVideoEleme
const [volume, setVolume] = useState(() => mediaRef.current?.volume ?? 1);
const [muted, setMuted] = useState(() => mediaRef.current?.muted ?? false);
// Sync state when the video element changes volume externally.
// Sync state when the media element changes volume externally.
useEffect(() => {
const media = mediaRef.current;
if (!media) return;

View File

@ -15,7 +15,7 @@
.media-preview-controls {
opacity: 0;
pointer-events: none;
pointer-events: none;
}
}