chooseCarForChargingRow.tsx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { View, Text, Image, StyleSheet, Pressable } from 'react-native';
  2. import React from 'react';
  3. import { StarSvg } from './SVG';
  4. import { router } from 'expo-router';
  5. const ChooseCarForChargingRow = ({
  6. imageUrl,
  7. VehicleName,
  8. isDefault
  9. }: {
  10. imageUrl?: any;
  11. VehicleName: string;
  12. isDefault: boolean;
  13. }) => (
  14. <Pressable onPress={() => router.push('/bookingConfirmationPage')}>
  15. <View className="relative bg-white w-44 h-[170px] overflow-hidden rounded-lg items-center justify-center mr-3 ">
  16. {isDefault && (
  17. <>
  18. <View style={styles.topLeftTriangle} />
  19. <View className="absolute top-1 left-1">
  20. <StarSvg />
  21. </View>
  22. </>
  23. )}
  24. <View className="items-center justify-center pt-4 space-y-2 ">
  25. <Image
  26. source={
  27. imageUrl ? imageUrl : require('../../assets/car2.png')
  28. }
  29. style={{ height: 72, width: 140 }}
  30. />
  31. <Text className="text-base text-[#222222]">{VehicleName}</Text>
  32. </View>
  33. </View>
  34. </Pressable>
  35. );
  36. export default ChooseCarForChargingRow;
  37. const styles = StyleSheet.create({
  38. grayColor: {
  39. color: '#888888'
  40. },
  41. topLeftTriangle: {
  42. width: 0,
  43. height: 0,
  44. borderLeftWidth: 50,
  45. borderBottomWidth: 50,
  46. borderLeftColor: '#02677D',
  47. borderBottomColor: 'transparent',
  48. position: 'absolute',
  49. top: 0,
  50. left: 0
  51. },
  52. text: {
  53. fontWeight: 300,
  54. color: '#000000'
  55. }
  56. });