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,9 +157,12 @@ 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") {
displayControls ? setMouseMoved(false) : show();
return;
}
e.preventDefault(); e.preventDefault();
touchCount++; touchCount++;
if (touchCount == 2) { if (touchCount == 2) {
@ -171,9 +174,7 @@ export const Player: QueryPage<{ slug: string }> = ({ slug }) => {
touchCount = 0; touchCount = 0;
}, 400); }, 400);
setPlay(!isPlaying); setPlay(!isPlaying);
} }}
: () => (displayControls ? setMouseMoved(false) : show())
}
{...css(StyleSheet.absoluteFillObject)} {...css(StyleSheet.absoluteFillObject)}
> >
<Video <Video