Ipad适配问题
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Image, Pressable, StyleSheet, Text, View } from 'react-native';
|
||||
import { Image, Pressable, StyleSheet, Text, View, Platform, useWindowDimensions } from 'react-native';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import SheetModal from '@/components/ui/SheetModal';
|
||||
@@ -15,8 +15,11 @@ type Props = {
|
||||
|
||||
export default function ThemeModal({ visible, mode, onSelect, onClose }: Props) {
|
||||
const { t } = useTranslation();
|
||||
const { width, height } = useWindowDimensions();
|
||||
const isTablet = Platform.OS === 'ios' && Math.min(width, height) >= 768;
|
||||
|
||||
return (
|
||||
<SheetModal visible={visible} title={t('theme.title')} onClose={onClose} height={360}>
|
||||
<SheetModal visible={visible} title={t('theme.title')} onClose={onClose} height={isTablet ? 560 : 360}>
|
||||
<View style={styles.row}>
|
||||
<ThemeCard
|
||||
title={t('theme.scenery')}
|
||||
@@ -100,9 +103,9 @@ const styles = StyleSheet.create({
|
||||
row: {
|
||||
flexDirection: 'row',
|
||||
flexWrap: 'nowrap',
|
||||
gap: 12,
|
||||
paddingHorizontal: 4,
|
||||
paddingBottom: 50,
|
||||
gap: 8,
|
||||
paddingHorizontal: 0,
|
||||
paddingBottom: 22,
|
||||
paddingTop: 20,
|
||||
justifyContent: 'space-between',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user