Added changes for showing 'view detail' instead of accordion icon (#143)
* added changes for showing 'view detail' instead of accordion * added changes for showing 'view detail' instead of accordion -fix1
This commit is contained in:
committed by
GitHub Enterprise
parent
57a9e81028
commit
3aa79500a6
@@ -9,14 +9,19 @@ import { AddressL1Details } from '../../types/addressGeolocation.types'
|
||||
import AddressItem from './AddressItem'
|
||||
|
||||
interface IAddressContainer {
|
||||
addressList?: AddressL1Details[]
|
||||
addressList?: AddressL1Details[]
|
||||
}
|
||||
|
||||
const AddressContainer: React.FC<IAddressContainer> = ({ addressList }) => {
|
||||
const AddressContainer: React.FC<IAddressContainer> = ({addressList}) => {
|
||||
const addressAccordionToggleStyle = [
|
||||
GenericStyles.fontSize12,
|
||||
GenericStyles.fw500,
|
||||
GenericStyles.textBlue
|
||||
];
|
||||
if (!addressList?.length) {
|
||||
return (
|
||||
<View style={[styles.noAddressContainer, GenericStyles.centerAligned, GenericStyles.columnDirection]}>
|
||||
<HomeIcon />
|
||||
<HomeIcon/>
|
||||
<Text style={[styles.textContainer, styles.noAddressText]}>
|
||||
No addresses found
|
||||
</Text>
|
||||
@@ -25,35 +30,34 @@ const AddressContainer: React.FC<IAddressContainer> = ({ addressList }) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<View>
|
||||
{
|
||||
addressList.map((address: AddressL1Details) => (
|
||||
<Accordion accordionStyle={{ paddingVertical: 28 }} accordionHeader={
|
||||
<AddressItem
|
||||
key={address?.addressDTO?.externalReferenceId}
|
||||
addressItem={address?.addressDTO}
|
||||
geoLocationList={address.matchingGeoLocations}
|
||||
showGeolocationBtn={true}
|
||||
/>
|
||||
}>
|
||||
<View>
|
||||
<Text style={[styles.textContainer, styles.accordionDetailHeading]}>
|
||||
Similar Addresses
|
||||
</Text>
|
||||
{
|
||||
address?.similarAddresses?.map((similarAddress: any) => (
|
||||
<AddressItem
|
||||
key={similarAddress?.addressDTO?.externalReferenceId}
|
||||
addressItem={similarAddress?.addressDTO}
|
||||
containerStyle={styles.card}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
</Accordion>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
<View>
|
||||
{
|
||||
addressList.map((address: AddressL1Details) => (
|
||||
<Accordion accordionStyle={{paddingVertical: 28}}
|
||||
accordionHeader={<AddressItem key={address?.addressDTO?.externalReferenceId}
|
||||
addressItem={address?.addressDTO}
|
||||
geoLocationList={address.matchingGeoLocations}
|
||||
showGeolocationBtn={true}/>}
|
||||
customExpandUi={{whenCollapsed: <Text style={addressAccordionToggleStyle}>View Details</Text>, whenExpanded: <Text style={addressAccordionToggleStyle}>Hide Details</Text>}}
|
||||
>
|
||||
<View>
|
||||
<Text style={[styles.textContainer, styles.accordionDetailHeading]}>
|
||||
Similar Addresses
|
||||
</Text>
|
||||
{
|
||||
address?.similarAddresses?.map((similarAddress: any) => (
|
||||
<AddressItem
|
||||
key={similarAddress?.addressDTO?.externalReferenceId}
|
||||
addressItem={similarAddress?.addressDTO}
|
||||
containerStyle={styles.card}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
</Accordion>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user