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

2351 add distance under icon #2361

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,14 @@ const StakeholderDetails = ({ onBackClick, isDesktop }) => {
direction="column"
justifyContent="flex-start"
alignItems="center"
gap={2}
sx={{ marginTop: ".2rem", marginRight: "1rem" }}
>
<StakeholderIcon stakeholder={selectedOrganization} />
<Typography variant="body2" align="center">
{Boolean(selectedOrganization?.distance) &&
`${selectedOrganization.distance?.toFixed(1)} mi`}
</Typography>
</Stack>
</Grid2>
<Grid2 xs={10}>
Expand Down Expand Up @@ -766,7 +771,7 @@ function normalizeSocialLink({ value, socialMedia }) {
value === "N/A" ||
value === "n/a" ||
value === "n / a" ||
value === "N / A" ||
value === "N / A" ||
!value
) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,14 @@ const StakeholderPreview = ({ stakeholder, onSelect, isDesktop }) => {
direction="column"
justifyContent="flex-start"
alignItems="center"
gap={2}
sx={{ marginTop: ".2rem", marginRight: "1rem", height: "100%" }}
>
<StakeholderIcon stakeholder={stakeholder} />
<Typography variant="body2" align="center">
{Boolean(stakeholder?.distance) &&
`${stakeholder.distance?.toFixed(1)} mi`}
</Typography>
</Stack>
</Grid2>

Expand Down
12 changes: 3 additions & 9 deletions client/src/hooks/useOrganizationBests.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,9 @@ export default function useOrganizationBests() {
useNoKnownEligibilityRequirementsFilter();
const { tenantTimeZone } = useSiteContext();

let latitude, longitude;
if (location.search && !searchCoordinates) {
const queryParams = new URLSearchParams(location.search);
longitude = Number(queryParams.get("longitude"));
latitude = Number(queryParams.get("latitude"));
} else {
longitude = searchCoordinates?.longitude || DEFAULT_COORDINATES.longitude;
latitude = searchCoordinates?.latitude || DEFAULT_COORDINATES.latitude;
}
const longitude =
searchCoordinates?.longitude || DEFAULT_COORDINATES.longitude;
const latitude = searchCoordinates?.latitude || DEFAULT_COORDINATES.latitude;

const dispatch = useAppDispatch();

Expand Down