使MyModal组件可自定义按钮文案;修改获取权限提示文案;简单修复修改头像时关闭权限弹窗会导致无法第二次请求权限的bug

This commit is contained in:
yezian 2024-03-25 14:21:16 +08:00
parent 7cd51c23ed
commit 65d6cc9db0
6 changed files with 22 additions and 7 deletions

View File

@ -46,14 +46,14 @@
[
"expo-camera",
{
"cameraPermission": "允许铁粉空间使用您的相机"
"cameraPermission": "允许铁粉空间使用您的相机,以便拍摄或录制您需要的内容"
}
],
[
"expo-media-library",
{
"photosPermission": "允许铁粉空间访问您的相册",
"savePhotosPermission": "允许铁粉空间保存图片到相册",
"photosPermission": "允许铁粉空间访问您的相册,以便您选择合适的图片进行上传",
"savePhotosPermission": "允许铁粉空间保存图片到相册,以便您稍后在相册中继续查看",
"isAccessMediaLocationEnabled": true
}
],

View File

@ -299,6 +299,7 @@ export default function MediaPickerModal({
setVisible={setRequestModalVisible}
title="权限申请"
content="该功能需要开启存储权限,用于选择上传媒体文件"
confirmText="继续"
cancel={() => {
setRequestModalVisible(false);
}}
@ -312,6 +313,7 @@ export default function MediaPickerModal({
setVisible={setOverlayVisible}
title="您还未打开媒体权限"
content="是否前往设置开启权限?"
confirmText="继续"
cancel={() => {
setOverlayVisible(false);
}}

View File

@ -8,6 +8,8 @@ export default function MyModal({
title,
content,
confirm,
confirmText,
cancelText,
}) {
const tailwind = useTailwind();
return (
@ -24,7 +26,7 @@ export default function MyModal({
}}
>
<View
style={tailwind("p-2 rounded-2xl bg-[#1E1C29] items-center w-3/4")}
style={tailwind("p-2 rounded-2xl bg-[#17161A] items-center w-3/4")}
>
<Text
style={tailwind(
@ -50,7 +52,7 @@ export default function MyModal({
"text-[#FFFFFF80] text-base font-medium text-center"
)}
>
取消
{cancelText ? cancelText : "取消"}
</Text>
</TouchableOpacity>
<TouchableOpacity
@ -62,7 +64,7 @@ export default function MyModal({
<Text
style={tailwind("text-white text-base font-medium text-center")}
>
确认
{confirmText ? confirmText : "确认"}
</Text>
</TouchableOpacity>
</View>

View File

@ -135,7 +135,7 @@ export default function SelectUserProfileItem({ navigation, route }) {
<View style={tailwind("flex-row justify-between items-center mt-2")}>
<Text style={tailwind("text-base text-white font-medium")}>头像</Text>
<TouchableOpacity
onPress={() => setMediaPickerModalVisible(true)}
onPress={() => setMediaPickerModalVisible(!mediaPickerModalVisible)}
style={tailwind("flex-row items-center")}
>
<Image

View File

@ -542,6 +542,11 @@
background-color: rgb(19 18 31 / var(--tw-bg-opacity))
}
.bg-\[\#17161A\] {
--tw-bg-opacity: 1;
background-color: rgb(23 22 26 / var(--tw-bg-opacity))
}
.bg-\[\#1E1C29\] {
--tw-bg-opacity: 1;
background-color: rgb(30 28 41 / var(--tw-bg-opacity))

View File

@ -724,6 +724,12 @@
"backgroundColor": "rgb(19 18 31 / var(--tw-bg-opacity))"
}
},
"bg-[#17161A]": {
"style": {
"--tw-bg-opacity": 1,
"backgroundColor": "rgb(23 22 26 / var(--tw-bg-opacity))"
}
},
"bg-[#1E1C29]": {
"style": {
"--tw-bg-opacity": 1,