changed pressed modal picker list item color

main
alex 2023-08-02 08:50:41 +00:00
parent 309bb2d249
commit e61fa08943
7 changed files with 25 additions and 52 deletions

View File

@ -1,6 +1,6 @@
import { useContext, useEffect, useState } from "react"; import { useContext, useEffect, useState } from "react";
import { AppContext, AppStyles, ModalContainer } from "../../utils"; import { AppContext, AppStyles, ModalContainer } from "../../utils";
import { Text, TouchableOpacity, View } from "react-native"; import { Pressable, Text, TouchableOpacity, View } from "react-native";
import { Divider } from "../Divider"; import { Divider } from "../Divider";
import MyIcon from "../Icon"; import MyIcon from "../Icon";
import MyTextInput from "../TextInput"; import MyTextInput from "../TextInput";
@ -113,13 +113,22 @@ export function MyPickerModalListItem({
return ( return (
<> <>
<TouchableOpacity onPress={onPress} disabled={disabled}> <Pressable
onPress={onPress}
disabled={disabled}
style={({ pressed }) => [
{
backgroundColor: pressed
? appContext.appTheme.modal.pressedPickerItemColor
: appContext.appTheme.backgroundColor,
},
]}
>
<View <View
style={{ style={{
flexDirection: "row", flexDirection: "row",
justifyContent: "space-between", justifyContent: "space-between",
marginLeft: 10, padding: 12,
marginRight: 10,
}} }}
> >
<Text <Text
@ -140,9 +149,7 @@ export function MyPickerModalListItem({
/> />
)} )}
</View> </View>
</TouchableOpacity> </Pressable>
<Divider />
</> </>
); );
} }

View File

@ -31,7 +31,7 @@ export default function CreateSceneModalContent({ navigation }) {
]; ];
return ( return (
<ModalContainer> <ModalContainer withoutPadding>
<FlatList <FlatList
data={options} data={options}
keyExtractor={(item) => item.id} keyExtractor={(item) => item.id}

View File

@ -21,7 +21,7 @@ export default function ChooseSceneModalContent({ navigation, route }) {
); );
return ( return (
<ModalContainer> <ModalContainer withoutPadding>
{deviceScenes.length === 0 ? ( {deviceScenes.length === 0 ? (
<MyResult <MyResult
text={t("screens.device.scenes.modalChooseScene.noResult")} text={t("screens.device.scenes.modalChooseScene.noResult")}

View File

@ -1,18 +0,0 @@
import { useContext } from "react";
import { AppContext } from "../../utils";
import { Text, View } from "react-native";
export default function FaqScreen() {
const appContext = useContext(AppContext);
return (
<View
style={{
backgroundColor: appContext.appTheme.backgroundColor,
height: "100%",
}}
>
<Text>Feedback</Text>
</View>
);
}

View File

@ -1,18 +0,0 @@
import { useContext } from "react";
import { AppContext } from "../../utils";
import { Text, View } from "react-native";
export default function FeedbackScreen() {
const appContext = useContext(AppContext);
return (
<View
style={{
backgroundColor: appContext.appTheme.backgroundColor,
height: "100%",
}}
>
<Text>Feedback</Text>
</View>
);
}

View File

@ -1,5 +1,5 @@
import { useContext } from "react"; import { useContext } from "react";
import { AppContext } from "../../../utils"; import { AppContext } from "../../utils";
import { Text, View } from "react-native"; import { Text, View } from "react-native";
export default function HelpScreen() { export default function HelpScreen() {

View File

@ -54,10 +54,6 @@ export const AppStyles = StyleSheet.create({
shadowOpacity: 0.2, // only ios shadowOpacity: 0.2, // only ios
shadowRadius: 1, // only ios shadowRadius: 1, // only ios
}, },
modal: {
flex: 1,
padding: 10,
},
disabled: { disabled: {
opacity: 0.6, opacity: 0.6,
}, },
@ -108,6 +104,9 @@ const DarkAppTheme = {
}, },
}, },
colorPickerDisabled: "rgba(0, 0, 0, 0.3)", colorPickerDisabled: "rgba(0, 0, 0, 0.3)",
modal: {
pressedPickerItemColor: "rgba(0, 0, 0, 0.3)",
},
}; };
const LightAppTheme = { const LightAppTheme = {
@ -154,6 +153,9 @@ const LightAppTheme = {
}, },
}, },
colorPickerDisabled: "rgba(0, 0, 0, 0.3)", colorPickerDisabled: "rgba(0, 0, 0, 0.3)",
modal: {
pressedPickerItemColor: "rgba(0, 0, 0, 0.1)",
},
}; };
export async function StoreData(key, value) { export async function StoreData(key, value) {
@ -521,9 +523,9 @@ export function VibrateShort() {
Vibration.vibrate(50); Vibration.vibrate(50);
} }
export function ModalContainer({ children }) { export function ModalContainer({ children, withoutPadding }) {
return ( return (
<View style={AppStyles.modal}> <View style={[{ flex: 1 }, !withoutPadding && { padding: 10 }]}>
<View>{children}</View> <View>{children}</View>
</View> </View>
); );