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

Reusable HURUMap Components #1036

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
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
@@ -1,3 +1,5 @@
import { RichHeader } from "@hurumap/core";
import { Image } 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 +8,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
4 changes: 2 additions & 2 deletions apps/climatemappedafrica/src/components/Hero/Hero.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Section } from "@commons-ui/core";
import { RichTypography } from "@commons-ui/next";
import { RichHeader } from "@hurumap/core";
import { Image } 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/core";
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/core";
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
12 changes: 7 additions & 5 deletions apps/climatemappedafrica/src/pages/[[...slugs]].js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import {
AboutTeam,
DataVisualisationGuide,
HowItWorks,
PageHero,
Summary,
} from "@hurumap/core";
import { useRouter } from "next/router";
import { NextSeo } from "next-seo";
import React from "react";
import { SWRConfig } from "swr";

import AboutTeam from "@/climatemappedafrica/components/AboutTeam";
import DataIndicators from "@/climatemappedafrica/components/DataIndicators";
import DataVisualisationGuide from "@/climatemappedafrica/components/DataVisualisationGuide";
import ExplorePage from "@/climatemappedafrica/components/ExplorePage";
import Footer from "@/climatemappedafrica/components/Footer";
import Hero from "@/climatemappedafrica/components/Hero";
import HowItWorks from "@/climatemappedafrica/components/HowItWorks";
import Tutorial from "@/climatemappedafrica/components/HURUmap/Tutorial";
import Navigation from "@/climatemappedafrica/components/Navigation";
import PageHero from "@/climatemappedafrica/components/PageHero";
import Summary from "@/climatemappedafrica/components/Summary";
import {
getPageStaticPaths,
getPageStaticProps,
Expand Down
Loading
Loading