First commit of the new app
This commit is contained in:
47
assets/components/reserva/HotelCard.tsx
Normal file
47
assets/components/reserva/HotelCard.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import { HotelInfo } from '@/assets/types';
|
||||
import styles from '@/styles/screens/reserva/detail.styles';
|
||||
import { Image, Text, View } from 'react-native';
|
||||
import { formatDateLong } from './formatters';
|
||||
import { Stars } from './Stars';
|
||||
|
||||
type Props = {
|
||||
hotel: HotelInfo;
|
||||
isFirst: boolean;
|
||||
};
|
||||
|
||||
export function HotelCard({ hotel, isFirst }: Props) {
|
||||
const img = hotel.imagemexterna || hotel.imageminterna;
|
||||
|
||||
return (
|
||||
<View style={[styles.hotelRow, !isFirst && styles.blockBorderTop]}>
|
||||
<Image
|
||||
source={img ? { uri: img } : require('@/assets/icons/logo.png')}
|
||||
style={styles.hotelImage}
|
||||
/>
|
||||
<View style={styles.hotelInfo}>
|
||||
<Stars stars={hotel.stars} />
|
||||
<Text style={styles.hotelName} numberOfLines={2}>
|
||||
{hotel.name}
|
||||
</Text>
|
||||
{!!hotel.regime && (
|
||||
<Text style={styles.hotelMetaLine}>
|
||||
<Text style={styles.hotelMetaLabel}>Regime: </Text>
|
||||
<Text style={styles.hotelMetaValue}>{hotel.regime}</Text>
|
||||
</Text>
|
||||
)}
|
||||
{!!hotel.data && (
|
||||
<Text style={styles.hotelMetaLine}>
|
||||
<Text style={styles.hotelMetaLabel}>Check-In: </Text>
|
||||
<Text style={styles.hotelMetaValue}>{formatDateLong(hotel.data)}</Text>
|
||||
</Text>
|
||||
)}
|
||||
<Text style={styles.hotelMetaLine}>
|
||||
<Text style={styles.hotelMetaLabel}>Nr. de Noites: </Text>
|
||||
<Text style={styles.hotelMetaValue}>
|
||||
{hotel.noites} {hotel.noites === 1 ? 'noite' : 'noites'}
|
||||
</Text>
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user