Fix some bugs in tablet mode

This commit is contained in:
Paul Frazee
2023-09-28 13:42:38 -07:00
parent 6bf79dc2f7
commit a849793015
3 changed files with 17 additions and 14 deletions
+7 -4
View File
@@ -39,6 +39,7 @@ import {useAnimatedValue} from 'lib/hooks/useAnimatedValue'
import {formatCount} from '../util/numeric/format' import {formatCount} from '../util/numeric/format'
import {makeProfileLink} from 'lib/routes/links' import {makeProfileLink} from 'lib/routes/links'
import {TimeElapsed} from '../util/TimeElapsed' import {TimeElapsed} from '../util/TimeElapsed'
import {isWeb} from 'platform/detection'
const MAX_AUTHORS = 5 const MAX_AUTHORS = 5
@@ -450,10 +451,12 @@ const styles = StyleSheet.create({
overflowHidden: { overflowHidden: {
overflow: 'hidden', overflow: 'hidden',
}, },
pointer: { pointer: isWeb
// @ts-ignore web only ? {
cursor: 'pointer', // @ts-ignore web only
}, cursor: 'pointer',
}
: {},
outer: { outer: {
padding: 10, padding: 10,
@@ -1,5 +1,4 @@
import React from 'react' import React from 'react'
import {isNative} from 'platform/detection'
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
export const withBreakpoints = <P extends object>( export const withBreakpoints = <P extends object>(
@@ -8,12 +7,12 @@ export const withBreakpoints = <P extends object>(
Desktop: React.ComponentType<P>, Desktop: React.ComponentType<P>,
): React.FC<P> => ): React.FC<P> =>
function WithBreakpoints(props: P) { function WithBreakpoints(props: P) {
const {isMobile, isTabletOrMobile} = useWebMediaQueries() const {isMobile, isTablet} = useWebMediaQueries()
if (isMobile || isNative) { if (isMobile) {
return <Mobile {...props} /> return <Mobile {...props} />
} }
if (isTabletOrMobile) { if (isTablet) {
return <Tablet {...props} /> return <Tablet {...props} />
} }
return <Desktop {...props} /> return <Desktop {...props} />
@@ -64,12 +64,13 @@ const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
}, },
loadLatestTablet: { // @ts-ignore web only
// @ts-ignore web only loadLatestTablet: isWeb
left: '50vw', ? {
// @ts-ignore web only -prf left: '50vw',
transform: 'translateX(-282px)', transform: 'translateX(-282px)',
}, }
: {},
loadLatestDesktop: { loadLatestDesktop: {
// @ts-ignore web only // @ts-ignore web only
left: '50vw', left: '50vw',