Skip to content

Commit 22aaa33

Browse files
authored
Merge pull request #279 from bettersg/fix/address_not_showing_in_scheme
Fix address not showing in scheme page
2 parents dbe37c4 + a026189 commit 22aaa33

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

frontend/src/app/schemes/[schemeId]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ const mapToFullScheme = (rawData: FullSchemeData): Scheme => {
110110
}
111111
} else {
112112
// no physical branch. Group contact details together
113-
if (rawData.phone || rawData.email) {
113+
if (rawData.phone || rawData.email || rawData.address) {
114114
contacts.push({
115115
phones: rawData.phone && rawData.phone,
116116
emails: rawData.email && rawData.email,
117+
address: rawData.address && rawData.address[0],
117118
});
118119
}
119120
}

frontend/src/components/schemes/scheme-card.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ function SchemeCard({scheme}: SchemeCardProps) {
2323
width={60}
2424
radius="sm"
2525
classNames={{
26-
wrapper: 'shrink-0'
26+
wrapper: 'shrink-0',
27+
img: 'object-contain'
2728
}}
2829
/>
2930
<div className="flex flex-col">

frontend/src/components/schemes/scheme-contact-card.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ interface SchemeContactCardProps {
99
}
1010

1111
export default function SchemeContactCard({contact}: SchemeContactCardProps) {
12+
if (!contact.address && !contact.phones?.length && !contact.emails?.length) {
13+
return null;
14+
}
15+
1216
return (
1317
<Card
1418
className="p-4 flex flex-col gap-2"

0 commit comments

Comments
 (0)