Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Address and Map icon alignment #9722

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/components/Facility/FacilityHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,22 @@ const renderGeoOrganizations = (geoOrg: Organization) => {
};
});

return parentDetails
const filteredDetails = parentDetails
.reverse()
.concat({
label: getOrgLevelLabel(geoOrg.org_type, geoOrg.level_cache),
value: geoOrg.name,
})
.map((org, index) => (
<span key={org.value}>
<span className="text-muted-foreground">{org.value}</span>
{index < parentDetails.length - 1 && (
<span className="mx-2 text-muted-foreground/50">→</span>
)}
</span>
));
.slice(-2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LSG structure of a state/country can vary, we can't choose to trim it.
We should render everything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh okay will make the necessary changes for the same

Copy link
Contributor Author

@abhimanyurajeesh abhimanyurajeesh Jan 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bodhish

FORMAT 1
image

OR

FORMAT 2
image

Copy link
Member

@rithviknishad rithviknishad Jan 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think format 1, but orgs reversed would look good!

Also, add justify-between the phone number and address


return filteredDetails.map((org, index) => (
<span key={org.value} className="flex items-center flex-wrap">
<span className="text-muted-foreground">{org.value}</span>
{index < filteredDetails.length - 1 && (
<span className="mx-2">&nbsp;</span>
)}
</span>
));
};

export const FacilityHome = ({ facilityId }: Props) => {
Expand Down Expand Up @@ -286,7 +288,7 @@ export const FacilityHome = ({ facilityId }: Props) => {
<CardContent>
<div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:gap-12 mt-4">
<div className="flex items-start gap-3">
<MapPin className="mt-1 h-5 w-5 flex-shrink-0 text-muted-foreground" />
<MapPin className="mt-3 h-5 w-5 flex-shrink-0 text-muted-foreground" />
<div>
{facilityData?.geo_organization && (
<div className="mt-2 text-sm">
Expand Down
Loading