|
| 1 | +import { SafeAreaView, StyleSheet, Text, View, Pressable } from "react-native"; |
| 2 | +import MaterialIcons from "@expo/vector-icons/MaterialIcons"; |
| 3 | +import { Colors } from "../config/Colors"; |
| 4 | +import React from "react"; |
| 5 | + |
| 6 | +const UserIn = ({ queueLength, estimatedTime }) => { |
| 7 | + return ( |
| 8 | + <SafeAreaView style={styles.safeArea}> |
| 9 | + <View style={styles.container}> |
| 10 | + <View style={styles.textContainer}> |
| 11 | + <Text style={styles.header}>{`There ${ |
| 12 | + queueLength - 1 == 1 ? "is" : "are" |
| 13 | + } ${queueLength - 1} ${ |
| 14 | + queueLength - 1 == 1 ? "person" : "people" |
| 15 | + } ahead of you`}</Text> |
| 16 | + <Text |
| 17 | + style={styles.description} |
| 18 | + >{`Estimated wait time: ${estimatedTime} minutes`}</Text> |
| 19 | + </View> |
| 20 | + <Pressable style={styles.button}> |
| 21 | + <MaterialIcons name="exit-to-app" size={24} color="white" /> |
| 22 | + <Text style={{ fontWeight: "600", fontSize: 15, color: "white" }}> |
| 23 | + Leave the Queue |
| 24 | + </Text> |
| 25 | + </Pressable> |
| 26 | + </View> |
| 27 | + </SafeAreaView> |
| 28 | + ); |
| 29 | +}; |
| 30 | + |
| 31 | +export default UserIn; |
| 32 | + |
| 33 | +const styles = StyleSheet.create({ |
| 34 | + safeArea: { |
| 35 | + flex: 1, // Make SafeAreaView take the full screen height |
| 36 | + backgroundColor: Colors.Background, |
| 37 | + paddingHorizontal: 0, // Ensure no horizontal padding |
| 38 | + paddingVertical: 0, // Ensure no vertical padding |
| 39 | + width: "100%", |
| 40 | + }, |
| 41 | + container: { |
| 42 | + flex: 1, |
| 43 | + padding: 20, |
| 44 | + gap: 50, |
| 45 | + flexDirection: "column", |
| 46 | + alignItems: "center", |
| 47 | + justifyContent: "center", |
| 48 | + backgroundColor: Colors.Background, |
| 49 | + }, |
| 50 | + textContainer: { |
| 51 | + gap: 15, |
| 52 | + }, |
| 53 | + header: { |
| 54 | + fontSize: 24, |
| 55 | + fontWeight: "bold", |
| 56 | + textAlign: "center", |
| 57 | + color: Colors.Primary, |
| 58 | + }, |
| 59 | + description: { |
| 60 | + fontSize: 18, |
| 61 | + fontWeight: "600", |
| 62 | + textAlign: "center", |
| 63 | + color: "white", |
| 64 | + }, |
| 65 | + button: { |
| 66 | + flexDirection: "row", |
| 67 | + backgroundColor: Colors.Red, |
| 68 | + gap: 10, |
| 69 | + padding: 10, |
| 70 | + borderRadius: 5, |
| 71 | + alignItems: "center", |
| 72 | + justifyContent: "center", |
| 73 | + }, |
| 74 | +}); |
0 commit comments