feat: 设置页面

This commit is contained in:
jinyaqiu 2025-08-07 16:57:08 +08:00
parent b0eb244146
commit 140c726324
4 changed files with 14 additions and 15 deletions

View File

@ -11,7 +11,7 @@ import { checkNotificationPermission, getLocationPermission, getPermissions, req
import { ThemedText } from '@/components/ThemedText';
import { useAuth } from '@/contexts/auth-context';
import { fetchApi } from '@/lib/server-api-util';
import { Address, User, UserInfoDetails } from '@/types/user';
import { Address, User } from '@/types/user';
import * as Location from 'expo-location';
import { useFocusEffect, useRouter } from 'expo-router';
import * as SecureStore from 'expo-secure-store';
@ -20,7 +20,7 @@ import { useTranslation } from 'react-i18next';
import { Linking, Platform, Pressable, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { useSafeAreaInsets } from "react-native-safe-area-context";
const Setting = (props: { userInfo: UserInfoDetails }) => {
const Setting = () => {
const [userInfo, setUserInfo] = useState<User | null>(null);
const getUserInfo = async () => {
@ -210,7 +210,7 @@ const Setting = (props: { userInfo: UserInfoDetails }) => {
}, [])
return (
<View style={{ flex: 1, paddingTop: insets.top, marginBottom: insets.bottom }}>
<View style={{ flex: 1, paddingTop: insets.top, paddingBottom: insets.bottom, backgroundColor: '#fff' }}>
<Pressable
style={styles.centeredView}
>
@ -405,14 +405,11 @@ const Setting = (props: { userInfo: UserInfoDetails }) => {
const styles = StyleSheet.create({
centeredView: {
flex: 1,
justifyContent: 'flex-end',
backgroundColor: 'rgba(0,0,0,0.5)',
flex: 1
},
modalView: {
width: '100%',
height: '100%',
backgroundColor: 'white',
paddingHorizontal: 16,
},
modalHeader: {
@ -440,7 +437,8 @@ const styles = StyleSheet.create({
},
premium: {
backgroundColor: "#FAF9F6",
padding: 16,
paddingHorizontal: 16,
paddingVertical: 20,
borderRadius: 24,
flexDirection: 'row',
justifyContent: 'space-between',
@ -452,11 +450,11 @@ const styles = StyleSheet.create({
gap: 4,
backgroundColor: '#FAF9F6',
borderRadius: 24,
paddingVertical: 8
padding: 8
},
item: {
paddingHorizontal: 16,
paddingVertical: 8,
paddingVertical: 12,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',

View File

@ -120,6 +120,7 @@ const styles = StyleSheet.create({
justifyContent: 'center',
position: 'relative',
width: '100%',
paddingVertical: 4
},
title: {
color: 'white',

View File

@ -43,10 +43,9 @@ const styles = StyleSheet.create({
},
modalView: {
width: '100%',
height: '40%',
height: '50%',
backgroundColor: 'white',
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
borderRadius: 26,
},
modalHeader: {
flexDirection: 'row',

View File

@ -77,6 +77,7 @@ const PrivacyModal = ({ modalVisible, setModalVisible, type }: PrivacyModalProps
</View>
);
}
console.log(article);
return (
<Modal
@ -126,8 +127,8 @@ const styles = StyleSheet.create({
width: '100%',
height: '80%',
backgroundColor: 'white',
borderTopLeftRadius: 20,
borderTopRightRadius: 20,
borderTopLeftRadius: 26,
borderTopRightRadius: 26,
paddingHorizontal: 16,
},
modalHeader: {