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 {makeProfileLink} from 'lib/routes/links'
import {TimeElapsed} from '../util/TimeElapsed'
import {isWeb} from 'platform/detection'
const MAX_AUTHORS = 5
@@ -450,10 +451,12 @@ const styles = StyleSheet.create({
overflowHidden: {
overflow: 'hidden',
},
pointer: {
// @ts-ignore web only
cursor: 'pointer',
},
pointer: isWeb
? {
// @ts-ignore web only
cursor: 'pointer',
}
: {},
outer: {
padding: 10,
@@ -1,5 +1,4 @@
import React from 'react'
import {isNative} from 'platform/detection'
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
export const withBreakpoints = <P extends object>(
@@ -8,12 +7,12 @@ export const withBreakpoints = <P extends object>(
Desktop: React.ComponentType<P>,
): React.FC<P> =>
function WithBreakpoints(props: P) {
const {isMobile, isTabletOrMobile} = useWebMediaQueries()
const {isMobile, isTablet} = useWebMediaQueries()
if (isMobile || isNative) {
if (isMobile) {
return <Mobile {...props} />
}
if (isTabletOrMobile) {
if (isTablet) {
return <Tablet {...props} />
}
return <Desktop {...props} />
@@ -64,12 +64,13 @@ const styles = StyleSheet.create({
alignItems: 'center',
justifyContent: 'center',
},
loadLatestTablet: {
// @ts-ignore web only
left: '50vw',
// @ts-ignore web only -prf
transform: 'translateX(-282px)',
},
// @ts-ignore web only
loadLatestTablet: isWeb
? {
left: '50vw',
transform: 'translateX(-282px)',
}
: {},
loadLatestDesktop: {
// @ts-ignore web only
left: '50vw',