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

Fix/modal #1124

Merged
merged 1 commit into from
May 23, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/components/map/controls/basemap-settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const BasemapSettings = ({ className }: { className?: string }) => {
<BasemapsContextualMapSettings />
</Helper>
</div>
<DialogClose onClose={close} />
<DialogClose />
</DialogContent>
</Dialog>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/controls/share/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const Share = ({
</div>
</div>
</div>
<DialogClose onClose={close} />
<DialogClose />
</DialogContent>
</Dialog>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/datasets/biomass/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const widgetSlug = 'aboveground_biomass';
const COLORS = ['#EAF19D', '#B8E98E', '#1B97C1', '#1C52A3', '#13267F'];

const getColorKeys = (data: Data[] = []) =>
data.reduce((acc, d, i) => {
data?.reduce((acc, d, i) => {
return {
...acc,
[d.indicator]: COLORS[i],
Expand Down
2 changes: 1 addition & 1 deletion src/containers/datasets/fisheries/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type { DataResponse, Data } from './types';
const COLORS = ['#F3E79B', '#FAC484', '#F0746E', '#B9257A', '#701A64'];

const getColorKeys = (data) =>
data.reduce(
data?.reduce(
(acc, d, index) => ({
...acc,
[d]: COLORS[index],
Expand Down
4 changes: 2 additions & 2 deletions src/containers/datasets/height/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const getData = (data: Data[], unit, COLORS_BY_INDICATOR: ColorKeysTypes) => {
const barsValues = data?.map(({ value }) => value);
const total = barsValues.reduce((previous, current) => current + previous);
return [
data.reduce((acc, d) => {
data?.reduce((acc, d) => {
const percentage = (d.value / total) * 100;
return {
...acc,
Expand All @@ -58,7 +58,7 @@ const getData = (data: Data[], unit, COLORS_BY_INDICATOR: ColorKeysTypes) => {
};

const getBars = (data: Data[], COLORS_BY_INDICATOR: ColorKeysTypes) =>
data.reduce(
data?.reduce(
(acc, d) => ({
...acc,
[`${d.indicator} m`]: {
Expand Down
2 changes: 1 addition & 1 deletion src/containers/datasets/iucn-ecoregion/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type DataResponse = {
};

const getColorKeys = (data: Data[]) =>
data.reduce(
data?.reduce(
(acc, d) => ({
...acc,
[d.category]: COLORS[d.category],
Expand Down
2 changes: 1 addition & 1 deletion src/store/widgets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ContextualBasemapsId, WidgetSlugType } from 'types/widget';
// by default we want to show all widgets in the distribution and change category
const defaultCategory: Category = 'distribution_and_change';
const defaultWidgets = widgets
.filter((widget) => widget.categoryIds.includes(defaultCategory))
.filter((widget) => widget.categoryIds?.includes(defaultCategory))
.map((widget) => widget.slug) satisfies WidgetSlugType[];

export const activeWidgetsAtom = atom<(WidgetSlugType | ContextualBasemapsId | 'custom-area')[]>({
Expand Down
Loading