Fix some bugs in tablet mode
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user