Skip to content

Reusable HURUMap Components #1036

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

Merged
merged 26 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
606dd60
Move AboutTeam to hurumap/core
kelvinkipruto Jan 28, 2025
bff4c65
Move DataVisualisationGuide to hurumap/core
kelvinkipruto Jan 28, 2025
f82c458
Move Header to hurumap/core
kelvinkipruto Jan 28, 2025
9183ed9
Move HowItWorks to hurumap/core
kelvinkipruto Jan 28, 2025
483b037
Move LineClampedRichTypography to hurumap/core
kelvinkipruto Jan 28, 2025
f94ba06
Reuse link
kelvinkipruto Jan 28, 2025
fd7d22c
Move Loading to hurumap/core
kelvinkipruto Jan 28, 2025
56a7a9a
Move Menu to hurumap/core
kelvinkipruto Jan 28, 2025
2bb3df5
Move NextImageButton to hurumap/core
kelvinkipruto Jan 28, 2025
0301b68
Move PageHero to hurumap/core
kelvinkipruto Jan 28, 2025
4729a75
Move Summary to hurumap/core
kelvinkipruto Jan 28, 2025
9cb3034
Move Tabs to hurumap/core
kelvinkipruto Jan 28, 2025
f9bf746
Merge branch 'main' into chore/reusable-hurumap-components
kelvinkipruto Feb 3, 2025
da63dc5
Merge branch 'main' into chore/reusable-hurumap-components
kelvinkipruto Feb 11, 2025
f7522e6
Merge branch 'main' into chore/reusable-hurumap-components
koechkevin Feb 20, 2025
7c28007
Fix failing tests
koechkevin Feb 20, 2025
858d9aa
Merge branch 'main' into chore/reusable-hurumap-components
kelvinkipruto Feb 25, 2025
7d74adb
Update README
kelvinkipruto Mar 3, 2025
85b2701
Doc Update
kelvinkipruto Mar 3, 2025
0a2739a
Refractore HURUMap components
kelvinkipruto Mar 4, 2025
eea4035
Merge branch 'main' into chore/reusable-hurumap-components
kelvinkipruto Mar 5, 2025
5b18e15
Move Summary to hurumap/next
kelvinkipruto Mar 6, 2025
2c565e8
Move AboutTeam and PageHero to hurumap/next
kelvinkipruto Mar 6, 2025
69d60e0
Update Deps
kelvinkipruto Mar 6, 2025
305bd07
Update Dependencies
kelvinkipruto Mar 6, 2025
7b2a1b0
Fix Spelling
kelvinkipruto Mar 6, 2025
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
2 changes: 2 additions & 0 deletions apps/climatemappedafrica/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ module.exports = {
"<rootDir>/../../packages/commons-ui-next/src/$1",
"^@/commons-ui/payload/(.*)$":
"<rootDir>/../../packages/commons-ui-payload/src/$1",
"^@/hurumap/core/(.*)$": "<rootDir>/../../packages/hurumap-core/src/$1",
"^@/hurumap/next/(.*)$": "<rootDir>/../../packages/hurumap-next/src/$1",
},
transformIgnorePatterns: ["<rootDir>/node_modules/(?!camelcase-keys)"],
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Image, RichHeader } from "@hurumap/next";
import { Box, ClickAwayListener, Grid, Slide } from "@mui/material";
import PropTypes from "prop-types";
import React, { useState } from "react";
Expand All @@ -6,8 +7,6 @@ import Icon from "./Icon";
import IndicatorPanel from "./IndicatorPanel";

import bg from "@/climatemappedafrica/assets/images/Mask Group 8.png";
import Image from "@/climatemappedafrica/components/Image";
import RichHeader from "@/climatemappedafrica/components/RichHeader";

function DataIndicators({ indicators, title }) {
const [checked, setChecked] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Link } from "@commons-ui/next";
import {
IconButton,
InputBase,
Expand All @@ -12,7 +13,6 @@ import PropTypes from "prop-types";
import React, { useEffect, useState } from "react";

import SearchIcon from "@/climatemappedafrica/assets/icons/search.svg";
import Link from "@/climatemappedafrica/components/Link";

function DropdownSearch({
IconButtonProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Link } from "@commons-ui/next";
import { useReducer } from "react";

import Link from "@/climatemappedafrica/components/Link";

function extendProfileTags(profile, options, explorePagePath) {
const { tags: originalTags, ...other } = profile || {};
if (!originalTags) {
Expand Down
4 changes: 1 addition & 3 deletions apps/climatemappedafrica/src/components/Footer/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Copyright, QuickLinks, StayInTouch, Section } from "@commons-ui/core";
import { Link } from "@commons-ui/next";
import { Link, NextImageButton } from "@commons-ui/next";
import { RichText } from "@commons-ui/payload";
import { Box, Grid } from "@mui/material";
import React from "react";

import NextImageButton from "@/climatemappedafrica/components/NextImageButton";

function Footer(props) {
const {
title,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Image } from "@hurumap/next";
import {
Box,
Button,
Expand All @@ -10,7 +11,6 @@ import PropTypes from "prop-types";
import React from "react";

import CloseIcon from "@/climatemappedafrica/assets/icons/closeBlack.svg";
import Image from "@/climatemappedafrica/components/Image";
import slugify from "@/climatemappedafrica/utils/slugify";

function SvgIcon(props) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Section } from "@commons-ui/core";
import { Tabs } from "@hurumap/next";
import { Button, Typography, useTheme } from "@mui/material";
import PropTypes from "prop-types";
import React from "react";
Expand All @@ -9,7 +10,6 @@ import printIcon from "@/climatemappedafrica/assets/icons/print.svg?url";
import TopIcon from "@/climatemappedafrica/assets/icons/top.svg";
import LocationHeader from "@/climatemappedafrica/components/HURUmap/LocationHeader";
import PinAndCompare from "@/climatemappedafrica/components/HURUmap/PinAndCompare";
import Tabs from "@/climatemappedafrica/components/Tabs";
import { hurumapArgs } from "@/climatemappedafrica/config";

// being last is necessary for style override to work
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-env browser */
import { Link } from "@commons-ui/next";
import { Box, Button, Popover } from "@mui/material";
import PropTypes from "prop-types";
import React from "react";

import Caret from "@/climatemappedafrica/assets/icons/caret.svg";
import Link from "@/climatemappedafrica/components/Link";
import slugify from "@/climatemappedafrica/utils/slugify";

function SubcategoryList({ items }) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Loading } from "@hurumap/core";
import { Box } from "@mui/material";
import PropTypes from "prop-types";
import React, { forwardRef } from "react";
Expand All @@ -7,7 +8,6 @@ import ProfileItems from "./ProfileItems";
import printIcon from "@/climatemappedafrica/assets/icons/print.svg?url";
import LocationHeader from "@/climatemappedafrica/components/HURUmap/LocationHeader";
import PinAndCompare from "@/climatemappedafrica/components/HURUmap/PinAndCompare";
import Loading from "@/climatemappedafrica/components/Loading";
import { hurumapArgs } from "@/climatemappedafrica/config";

const Profile = forwardRef(function Profile(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Loading } from "@hurumap/core";
import { Grid } from "@mui/material";
import dynamic from "next/dynamic";
import PropTypes from "prop-types";
Expand All @@ -6,7 +7,6 @@ import React, { Fragment, memo } from "react";
import CategoryHeader from "@/climatemappedafrica/components/HURUmap/CategoryHeader";
import KeyMetric from "@/climatemappedafrica/components/HURUmap/KeyMetric";
import SubcategoryHeader from "@/climatemappedafrica/components/HURUmap/SubcategoryHeader";
import Loading from "@/climatemappedafrica/components/Loading";
import formatNumericalValue from "@/climatemappedafrica/utils/formatNumericalValue";
import slugify from "@/climatemappedafrica/utils/slugify";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { RichText } from "@commons-ui/payload";
import { Image } from "@hurumap/next";
import { Grid, Typography, IconButton, Avatar, Box } from "@mui/material";
import { useTour } from "@reactour/tour";
import PropTypes from "prop-types";
import React from "react";

import CloseIcon from "@/climatemappedafrica/assets/icons/close.svg";
import Image from "@/climatemappedafrica/components/Image";

function TutorialStep({ description, title, image }) {
const { setIsOpen, currentStep } = useTour();
Expand Down
3 changes: 1 addition & 2 deletions apps/climatemappedafrica/src/components/Hero/Hero.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { Section } from "@commons-ui/core";
import { RichTypography } from "@commons-ui/next";
import { Image, RichHeader } from "@hurumap/next";
import { Box, Grid, useMediaQuery } from "@mui/material";
import dynamic from "next/dynamic";
import PropTypes from "prop-types";
import React from "react";

import heroBg from "@/climatemappedafrica/assets/images/bg-map-white.jpg";
import DropdownSearch from "@/climatemappedafrica/components/DropdownSearch";
import Image from "@/climatemappedafrica/components/Image";
import RichHeader from "@/climatemappedafrica/components/RichHeader";

const Map = dynamic(() => import("./Map"), { ssr: false });

Expand Down
132 changes: 0 additions & 132 deletions apps/climatemappedafrica/src/components/Link/index.js

This file was deleted.

47 changes: 0 additions & 47 deletions apps/climatemappedafrica/src/components/Link/index.stories.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { NextImageButton } from "@commons-ui/next";
import { Menu } from "@hurumap/next";
import { Grid } from "@mui/material";
import PropTypes from "prop-types";
import React from "react";

import Menu from "@/climatemappedafrica/components/Menu";
import NextImageButton from "@/climatemappedafrica/components/NextImageButton";

function DesktopNavigation({ explorePagePath, logo, menus, socialLinks, sx }) {
return (
<Grid container alignItems="center" sx={sx}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { NextImageButton } from "@commons-ui/next";
import { Grid, Button } from "@mui/material";
import { useTour } from "@reactour/tour";
import PropTypes from "prop-types";
import React from "react";

import SearchIcon from "@/climatemappedafrica/assets/icons/search-explore.svg";
import DropdownSearch from "@/climatemappedafrica/components/DropdownSearch";
import NextImageButton from "@/climatemappedafrica/components/NextImageButton";

function ExploreNavigation({
explorePagePath,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Section } from "@commons-ui/core";
import { NextImageButton } from "@commons-ui/next";
import { Menu } from "@hurumap/next";
import {
Grid,
Slide,
Expand All @@ -17,8 +19,6 @@ import SearchIcon from "@/climatemappedafrica/assets/icons/search-open.svg";
import MenuCloseIcon from "@/climatemappedafrica/assets/menu_close.svg";
import MenuOpenIcon from "@/climatemappedafrica/assets/menu_open.svg";
import DropdownSearch from "@/climatemappedafrica/components/DropdownSearch";
import Menu from "@/climatemappedafrica/components/Menu";
import NextImageButton from "@/climatemappedafrica/components/NextImageButton";

const Transition = React.forwardRef(function Transition(props, ref) {
return <Slide direction="left" timeout={1000} ref={ref} {...props} />;
Expand Down
Loading
Loading