Skip to content

Commit

Permalink
Merge pull request #764 from CodeForAfrica/ft/hurumap-package-setup
Browse files Browse the repository at this point in the history
Introduce @hurumap Package
  • Loading branch information
kelvinkipruto authored Jul 15, 2024
2 parents 828fe61 + ed0a99e commit e820c5d
Show file tree
Hide file tree
Showing 71 changed files with 3,899 additions and 5,704 deletions.
34 changes: 17 additions & 17 deletions apps/charterafrica/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
"db-rollback": "migrate-mongo down"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.600.0",
"@aws-sdk/lib-storage": "^3.600.0",
"@aws-sdk/client-s3": "^3.614.0",
"@aws-sdk/lib-storage": "^3.614.0",
"@commons-ui/core": "workspace:*",
"@commons-ui/next": "workspace:*",
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.4",
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.11.5",
"@mui/material": "^5.15.20",
"@mui/utils": "^5.15.20",
"@next/env": "^14.2.4",
"@mui/material": "^5.16.1",
"@mui/utils": "^5.16.1",
"@next/env": "^14.2.5",
"@nivo/core": "^0.84.0",
"@nivo/pie": "^0.84.0",
"@nivo/tooltip": "^0.84.0",
Expand All @@ -59,19 +59,19 @@
"@payloadcms/plugin-seo": "^2.3.2",
"@payloadcms/richtext-slate": "^1.5.2",
"@react-spring/web": "^9.7.3",
"@sentry/nextjs": "^8.12.0",
"@sentry/nextjs": "^8.17.0",
"airtable": "^0.12.2",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"leaflet": "^1.9.4",
"migrate-mongo": "^11.0.0",
"monaco-editor": "^0.50.0",
"next": "^14.2.4",
"next": "^14.2.5",
"next-seo": "^6.5.0",
"nodemailer-sendgrid": "^1.0.3",
"payload": "^2.22.2",
"payload": "^2.23.1",
"prop-types": "^15.8.1",
"qs": "^6.12.1",
"qs": "^6.12.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-leaflet": "^4.2.1",
Expand All @@ -81,20 +81,20 @@
"sharp": "^0.33.4",
"slate": "^0.103.0",
"swr": "^2.2.5",
"video.js": "^8.12.0",
"video.js": "^8.16.1",
"videojs-youtube": "^3.0.1"
},
"devDependencies": {
"@babel/core": "^7.24.7",
"@babel/core": "^7.24.8",
"@babel/preset-react": "^7.24.7",
"@babel/register": "^7.24.6",
"@babel/runtime": "^7.24.7",
"@babel/runtime": "^7.24.8",
"@commons-ui/testing-library": "workspace:*",
"@playwright/test": "^1.45.0",
"@playwright/test": "^1.45.1",
"@svgr/webpack": "^8.1.0",
"@swc/core": "^1.6.5",
"@swc/core": "^1.6.13",
"@types/express": "^4.17.21",
"@types/node": "^20.14.9",
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"babel-jest": "^29.7.0",
"eslint": "^8.57.0",
Expand All @@ -108,8 +108,8 @@
"prettier": "^3.3.2",
"react-test-renderer": "^18.3.1",
"ts-node": "^10.9.2",
"typescript": "^5.5.2",
"webpack": "^5.92.1"
"typescript": "^5.5.3",
"webpack": "^5.93.0"
},
"engines": {
"node": "20.x"
Expand Down
126 changes: 62 additions & 64 deletions apps/charterafrica/src/components/FeaturedVideos/FeaturedVideo.snap.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions apps/climatemappedafrica/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SENTRY_ENVIRONMENT=local
SENTRY_ORG=code-for-africa
SENTRY_PROJECT=hurumapclimate
2 changes: 0 additions & 2 deletions apps/climatemappedafrica/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/commons-ui/core/*": ["../../packages/commons-ui-core/src/*"],
"@/commons-ui/next/*": ["../../packages/commons-ui-next/src/*"],
"@/climatemappedafrica/*": ["./src/*"]
}
},
Expand Down
2 changes: 1 addition & 1 deletion apps/climatemappedafrica/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
},
output: "standalone",
reactStrictMode: false,
transpilePackages: ["@commons-ui/core", "@commons-ui/next"],
transpilePackages: ["@commons-ui/core", "@commons-ui/next", "@hurumap/core"],
webpack: (config) => {
config.module.rules.push({
test: /\.svg$/,
Expand Down
96 changes: 45 additions & 51 deletions apps/climatemappedafrica/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,92 +31,86 @@
"clean": "rm -rf .next .turbo node_modules"
},
"dependencies": {
"@apollo/client": "^3.8.8",
"@apollo/client": "^3.10.8",
"@commons-ui/core": "^0.1.0",
"@commons-ui/next": "workspace:*",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@hurumap/core": "workspace:*",
"@mui/lab": "5.0.0-alpha.155",
"@mui/material": "^5.14.20",
"@mui/styles": "^5.14.20",
"@mui/utils": "^5.14.20",
"@reactour/tour": "^3.6.1",
"aws-sdk": "^2.1516.0",
"clsx": "^2.0.0",
"@mui/material": "^5.16.1",
"@mui/styles": "^5.16.1",
"@mui/utils": "^5.16.1",
"@reactour/tour": "^3.7.0",
"aws-sdk": "^2.1658.0",
"clsx": "^2.1.1",
"d3-format": "^3.1.0",
"deepmerge": "^4.3.1",
"leaflet": "^1.9.4",
"lodash": "^4.17.21",
"next": "^14.1.1",
"next": "^14.2.5",
"next-images": "^1.8.5",
"next-seo": "^6.4.0",
"next-seo": "^6.5.0",
"papaparse": "^5.4.1",
"plaiceholder": "^2.5.0",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react": "^18.3.1",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18.2.0",
"react-dom": "^18.3.1",
"react-leaflet": "^4.2.1",
"react-multi-carousel": "^2.8.4",
"react-share": "^5.0.3",
"react-multi-carousel": "^2.8.5",
"react-share": "^5.1.0",
"react-vega": "^7.6.0",
"sharp": "^0.33.0",
"simplebar-react": "^3.2.4",
"swr": "^2.2.4",
"vega": "^5.26.1",
"vega-embed": "^6.23.0",
"vega-lite": "^5.16.3",
"sharp": "^0.33.4",
"simplebar-react": "^3.2.6",
"swr": "^2.2.5",
"vega": "^5.30.0",
"vega-embed": "^6.26.0",
"vega-lite": "^5.19.0",
"vega-tooltip": "^0.33.0",
"video.js": "^8.6.1",
"video.js": "^8.16.1",
"videojs-youtube": "^3.0.1",
"webpack": "^5.89.0",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@babel/core": "^7.23.6",
"@babel/eslint-parser": "^7.23.3",
"@babel/preset-env": "^7.23.6",
"@babel/preset-react": "^7.23.3",
"@babel/core": "^7.24.8",
"@babel/preset-env": "^7.24.8",
"@babel/preset-react": "^7.24.7",
"@commons-ui/testing-library": "workspace:*",
"@material-ui/codemod": "^4.5.1",
"@playwright/test": "^1.40.1",
"@storybook/addon-actions": "^7.6.4",
"@storybook/addon-essentials": "^7.6.4",
"@storybook/addon-links": "^7.6.4",
"@storybook/addons": "^7.6.4",
"@storybook/client-api": "^7.6.4",
"@storybook/components": "^7.6.4",
"@storybook/core-events": "^7.6.4",
"@storybook/react": "^7.6.4",
"@storybook/theming": "^7.6.4",
"@playwright/test": "^1.45.1",
"@storybook/addon-actions": "^7.6.20",
"@storybook/addon-essentials": "^7.6.20",
"@storybook/addon-links": "^7.6.20",
"@storybook/addons": "^7.6.17",
"@storybook/client-api": "^7.6.17",
"@storybook/components": "^7.6.20",
"@storybook/core-events": "^7.6.20",
"@storybook/react": "^7.6.20",
"@storybook/theming": "^7.6.20",
"@svgr/webpack": "^8.1.0",
"@types/node": "^18.19.3",
"@types/react": "^18.2.43",
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"apollo-link-rest": "^0.9.0",
"babel-jest": "^29.7.0",
"babel-loader": "^9.1.3",
"babel-plugin-module-resolver": "^4.1.0",
"babel-plugin-transform-imports": "^2.0.0",
"eslint": "^8.55.0",
"eslint": "^8.57.0",
"eslint-config-commons-ui": "workspace:*",
"eslint-import-resolver-babel-module": "^5.3.2",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-module-resolver": "^1.5.0",
"graphql": "^15.8.0",
"graphql": "^15.9.0",
"graphql-anywhere": "^4.2.8",
"husky": "^8.0.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"jest-config-commons-ui": "workspace:*",
"jscodeshift": "^0.15.1",
"jscodeshift": "^0.15.2",
"next-sitemap": "^1.9.12",
"playwright-config-commons-ui": "workspace:*",
"prettier": "^3.1.1",
"react-test-renderer": "^18.2.0",
"prettier": "^3.3.2",
"react-test-renderer": "^18.3.1",
"svg-url-loader": "^8.0.0",
"typescript": "^5.3.3"
},
"engines": {
"node": "18.x"
"typescript": "^5.5.3"
}
}
3 changes: 3 additions & 0 deletions apps/climatemappedafrica/src/components/ExplorePage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import PropTypes from "prop-types";
import React, { useEffect, useState } from "react";

import useExplore from "./useExplore";
import { primaryGeoStyles, secondaryGeoStyles } from "./useLayerStyles";
import useProfileGeography from "./useProfileGeography";
import useStyles from "./useStyles";

Expand Down Expand Up @@ -134,6 +135,8 @@ function ExplorePage({ panelProps, profile: profileProp, ...props }) {
onClick={handleClickMap}
onClickUnpin={handleClickUnpin}
zoom={7}
primaryGeoStyles={primaryGeoStyles}
secondaryGeoStyles={secondaryGeoStyles}
{...props}
className={classes.map}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import {
CHART_PRIMARY_COLOR_SCHEME,
CHART_SECONDARY_COLOR_SCHEME,
} from "@/climatemappedafrica/theme";

export const primaryGeoStyles = {
inactive: {
color: CHART_PRIMARY_COLOR_SCHEME[3],
fillColor: "#f8f8f8",
fillOpacity: 1,
weight: 1,
},
hoverOnly: {
out: {
color: CHART_PRIMARY_COLOR_SCHEME[3],
fillColor: CHART_PRIMARY_COLOR_SCHEME[2],
fillOpacity: 1,
weight: 1,
},
over: {
color: CHART_PRIMARY_COLOR_SCHEME[3],
fillColor: CHART_PRIMARY_COLOR_SCHEME[1],
fillOpacity: 1,
},
},
selected: {
out: {
color: CHART_PRIMARY_COLOR_SCHEME[3],
fillColor: CHART_PRIMARY_COLOR_SCHEME[1],
strokeWidth: 1,
opacity: 1,
fillOpacity: 1,
weight: 1.5,
},
over: {
color: CHART_PRIMARY_COLOR_SCHEME[3],
fillColor: CHART_PRIMARY_COLOR_SCHEME[1],
opacity: 1,
},
},
};

export const secondaryGeoStyles = {
...primaryGeoStyles,
hoverOnly: {
out: {
color: CHART_PRIMARY_COLOR_SCHEME[3],
fillColor: CHART_PRIMARY_COLOR_SCHEME[2],
fillOpacity: 1,
weight: 1,
},
over: {
color: CHART_SECONDARY_COLOR_SCHEME[3],
fillColor: CHART_SECONDARY_COLOR_SCHEME[1],
fillOpacity: 1,
opacity: 1,
},
},
selected: {
out: {
color: CHART_PRIMARY_COLOR_SCHEME[3],
fillColor: CHART_PRIMARY_COLOR_SCHEME[1],
strokeWidth: 1,
opacity: 1,
fillOpacity: 1,
weight: 1.5,
},
over: {
color: CHART_PRIMARY_COLOR_SCHEME[3],
fillColor: CHART_PRIMARY_COLOR_SCHEME[1],
opacity: 1,
},
},
};
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { LocationTag } from "@hurumap/core";
import { Box } from "@mui/material";
import clsx from "clsx";
import PropTypes from "prop-types";
import React from "react";

import useStyles from "./useStyles";

import LocationHighlight from "@/climatemappedafrica/components/HURUmap/LocationHighlight";
import LocationTag from "@/climatemappedafrica/components/HURUmap/LocationTag";

function Location({ className, highlights, isLoading, tags, ...props }) {
const classes = useStyles(props);
Expand All @@ -29,16 +28,16 @@ function Location({ className, highlights, isLoading, tags, ...props }) {
>
{tags.map((tag, index) => (
<LocationTag
key={`${tag.level}-${tag.name}`}
isLoading={isLoading}
{...tag}
active={index === tags.length - 1}
key={`${tag.level}-${tag.name}`}
isLoading={isLoading}
variant="highlight"
classes={{
root: classes.tag,
level: classes.tagLevel,
name: classes.tagName,
}}
sx={(theme) => ({
"&:not(:first-of-type)": {
marginLeft: theme.typography.pxToRem(10),
},
})}
/>
))}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ const useStyles = makeStyles(({ palette, typography }) => ({
)} ${typography.pxToRem(12)} ${typography.pxToRem(21)}`,
width: typography.pxToRem(600),
},
tag: {
"&:not(:first-of-type)": {
marginLeft: typography.pxToRem(10),
},
},
tagLevel: {},
tagName: {},
highlights: {
borderTop: `1px solid ${palette.grey.main}`,
marginTop: 4.5,
Expand Down
Loading

0 comments on commit e820c5d

Please sign in to comment.