Skip to content

Commit

Permalink
Used named params in propsifyBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Oct 25, 2024
1 parent d5c5827 commit 8a6a313
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
fetchProfileGeography,
} from "@/climatemappedafrica/lib/hurumap";

async function explorePage({ slugs }, _, __, hurumap) {
async function explorePage({ block: { slugs }, hurumap }) {
const {
initialLocation,
page: { value },
Expand Down
2 changes: 1 addition & 1 deletion apps/climatemappedafrica/src/lib/data/blockify/hero.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
fetchProfileGeography,
} from "@/climatemappedafrica/lib/hurumap";

export default async function hero(block, _, __, hurumap) {
export default async function hero({ block, hurumap }) {
const {
initialLocation: { center, name },
} = hurumap;
Expand Down
2 changes: 1 addition & 1 deletion apps/climatemappedafrica/src/lib/data/blockify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const blockify = async (blocks, api, context, hurumap) => {
const propsifyBlock = propsifyBlockBySlug[slug];

if (propsifyBlock) {
return propsifyBlock(block, api, context, hurumap);
return propsifyBlock({ block, api, context, hurumap });
}
return {
...block,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { imageFromMedia } from "@/climatemappedafrica/lib/data/utils";

async function pageHero(block) {
async function pageHero({ block }) {
const { background: media, ...others } = block;
let background = null;
if (media) {
Expand Down
2 changes: 1 addition & 1 deletion apps/climatemappedafrica/src/lib/data/blockify/team.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { equalsIgnoreCase } from "@/climatemappedafrica/utils";
const getCountryFromCode = (alpha3) =>
countries.find((c) => equalsIgnoreCase(c.alpha3, alpha3)) ?? null;

async function team(block, api, context) {
async function team({ block, api, context }) {
const { query } = context;
const data = await getMembers(api, query);
let members = null;
Expand Down

0 comments on commit 8a6a313

Please sign in to comment.