-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.2 build 2, allow multiple price feedbacks
- Loading branch information
Dominic Wrege
committed
Jul 12, 2024
1 parent
317449f
commit 496d609
Showing
5 changed files
with
305 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,30 @@ | ||
import React from "react"; | ||
import { SafeAreaView, Text, TouchableOpacity, StyleSheet } from "react-native"; | ||
import { useNavigation } from "@react-navigation/native"; | ||
import { Tariff } from "../../../types/tariff"; | ||
import { TariffCondition } from "../../../types/conditions"; | ||
import { SafeAreaView, Text, TouchableOpacity } from "react-native"; | ||
import { ScaledSheet } from "react-native-size-matters"; | ||
import { colors } from "../../theme"; | ||
|
||
interface FeedbackButtonProps { | ||
link: string | null | undefined; | ||
tariff: Tariff | null | undefined; | ||
tariffCondition: TariffCondition | null; | ||
operatorName: string; // Füge den Operatornamen hinzu | ||
operatorImageUrl: string; // Füge die OperatorImageUrl hinzu | ||
onPress: () => void; | ||
} | ||
|
||
export function FeedbackButton({ | ||
link, | ||
tariff, | ||
tariffCondition, | ||
operatorName, | ||
operatorImageUrl, | ||
}: FeedbackButtonProps): JSX.Element { | ||
const navigation = useNavigation(); | ||
|
||
if (!link) { | ||
return <></>; | ||
} | ||
|
||
const onPress = () => { | ||
navigation.navigate("Feedback", { | ||
tariff, | ||
tariffCondition, | ||
operatorName, | ||
operatorImageUrl, | ||
}); | ||
}; | ||
|
||
export function FeedbackButton({ onPress }: FeedbackButtonProps): JSX.Element { | ||
return ( | ||
<SafeAreaView style={{ marginTop: 10, marginHorizontal: 0 }}> | ||
<TouchableOpacity | ||
activeOpacity={0.8} | ||
style={styles.button} | ||
onPress={onPress} | ||
> | ||
<Text style={[styles.headerText, styles.underlinedText]}> | ||
<TouchableOpacity activeOpacity={0.8} onPress={onPress}> | ||
<Text style={[styles.underlinedText]}> | ||
{"Preise falsch? Dann sag dem Fuchs Bescheid!"} | ||
</Text> | ||
</TouchableOpacity> | ||
</SafeAreaView> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
button: { | ||
// Add your button styles here | ||
}, | ||
const styles = ScaledSheet.create({ | ||
underlinedText: { | ||
textDecorationLine: "underline", | ||
color: "grey", | ||
color: colors.ladefuchsGrayTextColor, | ||
fontFamily: "Bitter", | ||
fontSize: 15, | ||
lineHeight: 20, | ||
fontSize: "15@s", | ||
lineHeight: "20@s", | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.