Skip to content

Commit

Permalink
Switch from yarn to npm; repair dependency graph
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-low committed Feb 20, 2025
1 parent 1b2b9d4 commit 9273d45
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 8,711 deletions.
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@nivo/line": "^0.79.1",
"@nivo/radar": "^0.79.1",
"@popperjs/core": "^2.8.4",
"@react-leaflet/core": "^2.1.0",
"@react-leaflet/core": "^1.1.1",
"@rjsf/core": "^4.2.3",
"@turf/bbox": "^6.0.1",
"@turf/bbox-polygon": "^6.0.1",
Expand All @@ -65,6 +65,7 @@
"geojson-validation": "^1.0.2",
"geojsontoosm": "^0.0.3",
"graphql": "^16.0.1",
"intl-messageformat": "^10.7.15",
"leaflet": "^1.9.4",
"leaflet-lasso": "^2.2.13",
"leaflet-vectoricon": "https://github.com/CollinBeczak/Leaflet.VectorIcon",
Expand All @@ -78,21 +79,19 @@
"query-string": "^6.13.1",
"react": "^17.0.2",
"react-beautiful-dnd": "^13.0.0",
"react-burger-menu": "^2.4.4",
"react-burger-menu": "^3.1.0",
"react-calendar-heatmap": "^1.6.3",
"react-clickout": "^3.0.8",
"react-copy-to-clipboard": "^5.0.1",
"react-datepicker": "^3.0.0",
"react-delayed": "^0.2.0",
"react-dom": "^17.0.2",
"react-dom-confetti": "^0.1.3",
"react-dropzone": "^11.0.1",
"react-elastic-carousel": "^0.9.0",
"react-grid-layout": "^0.18.3",
"react-helmet": "^6.1.0",
"react-intl": "^6.5.5",
"react-intl-formatted-duration": "^4.0.0",
"react-leaflet": "^4.2.1",
"react-leaflet": "^3.2.5",
"react-leaflet-bing-v2": "^5.2.3",
"react-onclickoutside": "^6.6.3",
"react-popper": "^2.2.4",
Expand Down Expand Up @@ -130,10 +129,10 @@
"@types/node": "^22.10.5",
"@vitejs/plugin-react-swc": "^3.7.1",
"@vitest/coverage-v8": "^2.1.9",
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
"dotenv": "^16.4.5",
"dotenv-cli": "^7.4.2",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.7",
"eslint": "^8.54.0",
"eslint-plugin-jest": "^28.8.0",
"eslint-plugin-react": "^7.35.0",
Expand All @@ -148,7 +147,6 @@
"postcss-import": "^14.0.2",
"postcss-nested": "^5.0.6",
"postcss-simple-vars": "^6.0.3",
"react-test-renderer": "^16.2.0",
"redux-mock-store": "^1.4.0",
"shelljs": "^0.8.5",
"source-map-explorer": "^2.5.3",
Expand Down
3 changes: 0 additions & 3 deletions src/components/ConfirmAction/ConfirmAction.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from "prop-types";
import { Component, Fragment, cloneElement } from "react";
import { FormattedMessage } from "react-intl";
import External from "../External/External";
import { ExternalContext } from "../External/External";
import Modal from "../Modal/Modal";
import SvgSymbol from "../SvgSymbol/SvgSymbol";
import messages from "./Messages";
Expand All @@ -21,8 +20,6 @@ import "./ConfirmAction.scss";
* @author [Neil Rotstan](https://github.com/nrotstan)
*/
export default class ConfirmAction extends Component {
static contextType = ExternalContext;

originalAction = null;

state = {
Expand Down
16 changes: 1 addition & 15 deletions src/components/External/External.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
import PropTypes from "prop-types";
import { Component, createContext } from "react";
import { Component } from "react";
import ReactDOM from "react-dom";

const modalRoot = document.getElementById("external-root");

/**
* Context that can be used to temporarily suspend clickouts for components
* making use of External (which aren't otherwise detected as proper children
* by react-clickout since they've been moved around in the DOM). Components
* making use of react-clickout should check this context to see if any child
* components wish to temporarily suspend clickouts
*/
export const ExternalContext = createContext({
clickoutSuspended: false,
suspendClickout(isSuspended) {
this.clickoutSuspended = isSuspended;
},
});

export default class External extends Component {
el = document.createElement("div");

Expand Down
91 changes: 25 additions & 66 deletions src/components/FeaturedChallenges/FeaturedChallengesWidget.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import _map from "lodash/map";
import { Component, useRef } from "react";
import Carousel, { consts } from "react-elastic-carousel";
import { FormattedMessage } from "react-intl";
import { Link } from "react-router-dom";

import { WidgetDataTarget, registerWidgetType } from "../../services/Widget/Widget";
import CardChallenge from "../CardChallenge/CardChallenge";
import CardProject from "../CardProject/CardProject";
import WithFeatured from "../HOCs/WithFeatured/WithFeatured";
import QuickWidget from "../QuickWidget/QuickWidget";
import SvgSymbol from "../SvgSymbol/SvgSymbol";
import messages from "./Messages";

const descriptor = {
Expand All @@ -21,39 +19,20 @@ const descriptor = {
defaultHeight: 12,
};

export default class FeaturedChallengesWidget extends Component {
render() {
return (
<QuickWidget {...this.props} nomain className="">
<div className="mr-bg-black-10 mr-absolute mr-left-0 mr-top-0 mr-rounded-tl mr-rounded-bl mr-flex mr-flex-col mr-items-center mr-p-4 mr-pt-12 mr-h-full mr-w-56">
<h2 className="mr-text-yellow mr-text-md mr-font-normal mr-uppercase mr-text-center mr-leading-normal mr-w-2/3">
<FormattedMessage {...messages.header} />
</h2>
<div className="mr-bg-globe mr-h-40 mr-w-40 mr-mt-12"></div>
</div>

<div
className="mr-flex mr-h-full"
style={{ maxHeight: `${this.props.widgetLayout.h * 42}px` }}
>
<div className="mr-w-56 mr-min-w-52 mr-max-w-56"></div>
<FeaturedList {...this.props} />
</div>
</QuickWidget>
);
}
export default function FeaturedChallengesWidget(props) {
return (
<QuickWidget
{...props}
nomain
className=""
widgetTitle={<FormattedMessage {...messages.header} />}
>
<FeaturedList {...props} />
</QuickWidget>
);
}

const FeaturedList = (props) => {
const carouselRef = useRef(null);

const onNextStart = (currentItem, nextItem) => {
if (currentItem.index === nextItem.index) {
// we hit the last item, go to first item
carouselRef.current.goTo(0);
}
};

const projectCards = _map(props.featuredProjects.map, (project) => (
<CardProject
{...props}
Expand Down Expand Up @@ -88,15 +67,20 @@ const FeaturedList = (props) => {
}

return (
<Carousel
className="mr-max-h-full"
renderArrow={ArrowControl}
renderPagination={PaginationControl}
ref={carouselRef}
onNextStart={onNextStart}
<div
className="mr-flex mr-flex-row"
style={{
gap: "1em",
scrollSnapType: "x mandatory",
overflowX: "auto",
}}
>
{featuredItems}
</Carousel>
{featuredItems.map((item) => (
<div className="mr-w-full" style={{ scrollSnapAlign: "start", flexShrink: 0 }}>
{item}
</div>
))}
</div>
);
};

Expand All @@ -114,29 +98,4 @@ const BrowseControl = (props) => {
);
};

const ArrowControl = ({ type, onClick }) => (
<div className="mr-flex mr-flex-col mr-justify-center mr-items-center">
<SvgSymbol
sym={type === consts.PREV ? "icon-cheveron-left" : "icon-cheveron-right"}
viewBox="0 0 20 20"
className="mr-fill-green-lighter mr-w-8 mr-h-8 mr-cursor-pointer"
onClick={onClick}
/>
</div>
);

const PaginationControl = ({ pages, activePage, onClick }) => (
<div className="mr-flex">
{pages.map((page) => (
<SvgSymbol
key={page}
sym={page === activePage ? "circle-icon" : "circle-outline"}
viewBox={page === activePage ? "0 0 20 20" : "0 0 472 472"}
className="mr-fill-pink mr-w-4 mr-h-4 mr-mx-2 mr-cursor-pointer"
onClick={() => onClick(page)}
/>
))}
</div>
);

registerWidgetType(WithFeatured(FeaturedChallengesWidget), descriptor);
2 changes: 1 addition & 1 deletion src/components/SavedFilters/ManageSavedFilters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class ManageSavedFilters extends Component {
/>
</Modal>
</External>
<External data-react-clickout="exclude">
<External>
<Modal
isActive={this.props.managingFilters || false}
onClose={this.props.cancelManagingFilters}
Expand Down
Loading

0 comments on commit 9273d45

Please sign in to comment.