Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
Aniruddha-Gade committed Jan 3, 2024
1 parent ad54d6b commit 864a597
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
10 changes: 3 additions & 7 deletions App/components/Home/HospitalCard.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import React from 'react'
import { View, Text, Image, TouchableOpacity } from 'react-native'
import Colors from '../../../assets/shared/Colors'
import { useNavigation } from '@react-navigation/native'


export const HospitalCard = ({ hospital }) => {

const navigation = useNavigation()


return (
<TouchableOpacity onPress={() => navigation.navigate('hospital-details')}>


return (
<View>
<View style={{ width: 200, borderRadius: 10, borderWidth: 1, borderColor: Colors.ligh_gray, marginRight: 10 }}>
<Image
source={{ uri: hospital.attributes.Image.data.attributes.url }}
Expand All @@ -27,6 +23,6 @@ export const HospitalCard = ({ hospital }) => {
</Text>
</View>
</View>
</TouchableOpacity>
</View>
)
}
13 changes: 8 additions & 5 deletions App/components/Home/PremiumHospital.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React, { useEffect, useState } from 'react';
import { View, Text, FlatList } from 'react-native';
import { View, Text, FlatList, TouchableOpacity } from 'react-native';
import SubHeading from './SubHeading';
import globalApi from '../../../services/globalApi';
import { HospitalCard } from './HospitalCard';


import { useNavigation } from '@react-navigation/native'



const PremiumHospital = () => {

const [hospitalList, setHospitalList] = useState([]);
const navigation = useNavigation()


useEffect(() => {
getPremiumHospital()
Expand All @@ -36,8 +37,10 @@ const PremiumHospital = () => {
horizontal
showsHorizontalScrollIndicator={false}
renderItem={({ item, index }) => (
<HospitalCard hospital={item} key={index} />
)}w
<TouchableOpacity onPress={() => navigation.navigate('hospital-details', { hospital: item })}>
<HospitalCard hospital={item} key={index} />
</TouchableOpacity>
)}
/>

</View>
Expand Down

0 comments on commit 864a597

Please sign in to comment.