diff --git a/apps/codeforafrica/payload.config.ts b/apps/codeforafrica/payload.config.ts index 83c3e6173..552e022ed 100644 --- a/apps/codeforafrica/payload.config.ts +++ b/apps/codeforafrica/payload.config.ts @@ -12,6 +12,7 @@ import Authors from "./src/payload/collections/Authors"; import Donors from "./src/payload/collections/Donors"; import GuidingPrinciples from "./src/payload/collections/GuidingPrinciples"; import Impact from "./src/payload/collections/Impact"; +import Locations from "./src/payload/collections/Locations"; import Media from "./src/payload/collections/Media"; import Members from "./src/payload/collections/Members"; import Pages from "./src/payload/collections/Pages"; @@ -57,6 +58,7 @@ export default buildConfig({ Donors, GuidingPrinciples, Impact, + Locations, Media, Members, Pages, diff --git a/apps/codeforafrica/src/components/AddressCard/AddressCard.js b/apps/codeforafrica/src/components/AddressCard/AddressCard.js index cc1c87aa7..daf4f33fa 100644 --- a/apps/codeforafrica/src/components/AddressCard/AddressCard.js +++ b/apps/codeforafrica/src/components/AddressCard/AddressCard.js @@ -13,14 +13,23 @@ const AddressCardRoot = styled(Card)(({ theme, ownerState }) => ({ })); const AddressCard = React.forwardRef(function AddressCard(props, ref) { - const { active, content, onClick, title } = props; + const { + active, + addressLine1, + addressLine2, + zipcode, + city, + country, + onClick, + title, + } = props; const handleClick = (e) => { if (onClick) { onClick(e, title); } }; - if (!(title && content)) { + if (!title) { return null; } const ownerState = { active }; @@ -38,12 +47,37 @@ const AddressCard = React.forwardRef(function AddressCard(props, ref) { {title} as a line i.e.no margins. sx={{ color: "inherit", pt: 1.25, "& p": { m: 0 } }} variant="body3" > - {content} + {addressLine1} + + + {addressLine2} + + + {zipcode}, + + + {city} + + + {country} diff --git a/apps/codeforafrica/src/components/OfficeAddresses/OfficeAddresses.js b/apps/codeforafrica/src/components/OfficeAddresses/OfficeAddresses.js index 6b23a306b..0f5651684 100644 --- a/apps/codeforafrica/src/components/OfficeAddresses/OfficeAddresses.js +++ b/apps/codeforafrica/src/components/OfficeAddresses/OfficeAddresses.js @@ -18,7 +18,7 @@ const OfficeAddressesRoot = styled(Box)(({ theme, ownerState }) => ({ })); const OfficeAddresses = React.forwardRef(function OfficeAddresses(props, ref) { - const { addresses, height = 700, map, title, ...other } = props; + const { addresses = [], height = 700, map, title, apiKey, ...other } = props; const [activeAddress, setActiveAddress] = React.useState( addresses?.[0] ?? null, ); @@ -33,8 +33,17 @@ const OfficeAddresses = React.forwardRef(function OfficeAddresses(props, ref) { } const ownerState = { height }; const mapStyle = { height, width: "100%", ...map?.style }; + const position = { + lng: activeAddress?.location?.[0], + lat: activeAddress?.location?.[1], + }; return ( - + - +