Small cleanups

This commit is contained in:
Zoe Roux 2023-01-08 16:28:12 +09:00 committed by Zoe Roux
parent 4b7f59e2e9
commit a6c645c33f
2 changed files with 19 additions and 18 deletions

View File

@ -35,7 +35,7 @@ export const tooltip = (tooltip: string, up?: boolean) =>
}); });
export const WebTooltip = ({ theme }: { theme: Theme }) => { export const WebTooltip = ({ theme }: { theme: Theme }) => {
const background = `${theme.colors.black}CC`; const background = `${theme.light.colors.black}CC`;
return ( return (
<style jsx global>{` <style jsx global>{`

View File

@ -157,23 +157,24 @@ export const Player: QueryPage<{ slug: string }> = ({ slug }) => {
> >
<Pressable <Pressable
focusable={false} focusable={false}
onPress={ onPress={(e) => {
Platform.OS === "web" // TODO: use onPress event to diferenciate touch and click on the web (requires react native web 0.19)
? (e) => { if (Platform.OS !== "web") {
e.preventDefault(); displayControls ? setMouseMoved(false) : show();
touchCount++; return;
if (touchCount == 2) { }
touchCount = 0; e.preventDefault();
setFullscreen(!isFullscreen); touchCount++;
clearTimeout(touchTimeout); if (touchCount == 2) {
} else touchCount = 0;
touchTimeout = setTimeout(() => { setFullscreen(!isFullscreen);
touchCount = 0; clearTimeout(touchTimeout);
}, 400); } else
setPlay(!isPlaying); touchTimeout = setTimeout(() => {
} touchCount = 0;
: () => (displayControls ? setMouseMoved(false) : show()) }, 400);
} setPlay(!isPlaying);
}}
{...css(StyleSheet.absoluteFillObject)} {...css(StyleSheet.absoluteFillObject)}
> >
<Video <Video