Ipad适配问题
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { View, StyleSheet, TouchableOpacity, Text, Platform, ActivityIndicator } from 'react-native';
|
||||
import { View, StyleSheet, TouchableOpacity, Text, Platform, ActivityIndicator, useWindowDimensions } from 'react-native';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
import { LinearGradient } from 'expo-linear-gradient';
|
||||
@@ -20,6 +20,9 @@ interface ReminderStepProps {
|
||||
export function ReminderStep({ value, onChange, onFinish, loading = false }: ReminderStepProps) {
|
||||
const { t } = useTranslation();
|
||||
const insets = useSafeAreaInsets();
|
||||
const { width, height } = useWindowDimensions();
|
||||
const isTablet = Platform.OS === 'ios' && Math.min(width, height) >= 768;
|
||||
const contentMaxWidth = isTablet ? 560 : undefined;
|
||||
|
||||
const handleReduce = () => {
|
||||
// 本页最小为 1;不接收提醒请使用右上角 Skip
|
||||
@@ -32,7 +35,7 @@ export function ReminderStep({ value, onChange, onFinish, loading = false }: Rem
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<View style={styles.counterContainer}>
|
||||
<View style={[styles.counterContainer, contentMaxWidth ? { maxWidth: contentMaxWidth } : null]}>
|
||||
<TouchableOpacity onPress={handleReduce} disabled={loading} activeOpacity={0.7}>
|
||||
<ReduceIcon width={47} height={47} />
|
||||
</TouchableOpacity>
|
||||
|
||||
Reference in New Issue
Block a user