feat: 设置页面
This commit is contained in:
parent
b0eb244146
commit
140c726324
@ -11,7 +11,7 @@ import { checkNotificationPermission, getLocationPermission, getPermissions, req
|
|||||||
import { ThemedText } from '@/components/ThemedText';
|
import { ThemedText } from '@/components/ThemedText';
|
||||||
import { useAuth } from '@/contexts/auth-context';
|
import { useAuth } from '@/contexts/auth-context';
|
||||||
import { fetchApi } from '@/lib/server-api-util';
|
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 * as Location from 'expo-location';
|
||||||
import { useFocusEffect, useRouter } from 'expo-router';
|
import { useFocusEffect, useRouter } from 'expo-router';
|
||||||
import * as SecureStore from 'expo-secure-store';
|
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 { Linking, Platform, Pressable, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
|
||||||
const Setting = (props: { userInfo: UserInfoDetails }) => {
|
const Setting = () => {
|
||||||
const [userInfo, setUserInfo] = useState<User | null>(null);
|
const [userInfo, setUserInfo] = useState<User | null>(null);
|
||||||
|
|
||||||
const getUserInfo = async () => {
|
const getUserInfo = async () => {
|
||||||
@ -210,7 +210,7 @@ const Setting = (props: { userInfo: UserInfoDetails }) => {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{ flex: 1, paddingTop: insets.top, marginBottom: insets.bottom }}>
|
<View style={{ flex: 1, paddingTop: insets.top, paddingBottom: insets.bottom, backgroundColor: '#fff' }}>
|
||||||
<Pressable
|
<Pressable
|
||||||
style={styles.centeredView}
|
style={styles.centeredView}
|
||||||
>
|
>
|
||||||
@ -405,14 +405,11 @@ const Setting = (props: { userInfo: UserInfoDetails }) => {
|
|||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
centeredView: {
|
centeredView: {
|
||||||
flex: 1,
|
flex: 1
|
||||||
justifyContent: 'flex-end',
|
|
||||||
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
||||||
},
|
},
|
||||||
modalView: {
|
modalView: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
backgroundColor: 'white',
|
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 16,
|
||||||
},
|
},
|
||||||
modalHeader: {
|
modalHeader: {
|
||||||
@ -440,7 +437,8 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
premium: {
|
premium: {
|
||||||
backgroundColor: "#FAF9F6",
|
backgroundColor: "#FAF9F6",
|
||||||
padding: 16,
|
paddingHorizontal: 16,
|
||||||
|
paddingVertical: 20,
|
||||||
borderRadius: 24,
|
borderRadius: 24,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
@ -452,11 +450,11 @@ const styles = StyleSheet.create({
|
|||||||
gap: 4,
|
gap: 4,
|
||||||
backgroundColor: '#FAF9F6',
|
backgroundColor: '#FAF9F6',
|
||||||
borderRadius: 24,
|
borderRadius: 24,
|
||||||
paddingVertical: 8
|
padding: 8
|
||||||
},
|
},
|
||||||
item: {
|
item: {
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 16,
|
||||||
paddingVertical: 8,
|
paddingVertical: 12,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
|||||||
@ -120,6 +120,7 @@ const styles = StyleSheet.create({
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
|
paddingVertical: 4
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
color: 'white',
|
color: 'white',
|
||||||
|
|||||||
@ -43,10 +43,9 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
modalView: {
|
modalView: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '40%',
|
height: '50%',
|
||||||
backgroundColor: 'white',
|
backgroundColor: 'white',
|
||||||
borderTopLeftRadius: 20,
|
borderRadius: 26,
|
||||||
borderTopRightRadius: 20,
|
|
||||||
},
|
},
|
||||||
modalHeader: {
|
modalHeader: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
|
|||||||
@ -77,6 +77,7 @@ const PrivacyModal = ({ modalVisible, setModalVisible, type }: PrivacyModalProps
|
|||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
console.log(article);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
@ -126,8 +127,8 @@ const styles = StyleSheet.create({
|
|||||||
width: '100%',
|
width: '100%',
|
||||||
height: '80%',
|
height: '80%',
|
||||||
backgroundColor: 'white',
|
backgroundColor: 'white',
|
||||||
borderTopLeftRadius: 20,
|
borderTopLeftRadius: 26,
|
||||||
borderTopRightRadius: 20,
|
borderTopRightRadius: 26,
|
||||||
paddingHorizontal: 16,
|
paddingHorizontal: 16,
|
||||||
},
|
},
|
||||||
modalHeader: {
|
modalHeader: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user