Skip to content

Commit

Permalink
main menu new links
Browse files Browse the repository at this point in the history
  • Loading branch information
mluena committed Jan 14, 2025
1 parent c337780 commit d4743ae
Show file tree
Hide file tree
Showing 108 changed files with 290 additions and 112 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@radix-ui/react-switch": "^1.0.2",
"@radix-ui/react-toggle": "^1.0.2",
"@radix-ui/react-tooltip": "^1.0.5",
"@react-email/components": "^0.0.31",
"@react-email/components": "0.0.31",
"@tailwindcss/forms": "0.5.3",
"@tailwindcss/line-clamp": "0.4.2",
"@tailwindcss/typography": "0.5.9",
Expand Down Expand Up @@ -77,7 +77,7 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-dropzone": "14.2.3",
"react-email": "^3.0.4",
"react-email": "3.0.4",
"react-hook-form": "^7.54.2",
"react-map-gl": "7.0.21",
"react-markdown": "^9.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/chart/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createElement } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import {
PieChart,
Expand Down
2 changes: 1 addition & 1 deletion src/components/chart/tooltip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cn from 'lib/classnames';
import { cn } from 'lib/classnames';
type TooltipProps = {
payload: {
payload: {
Expand Down
72 changes: 72 additions & 0 deletions src/components/contact/actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
'use server';

import { z } from 'zod';

import mailchimp from '@/lib/mailchimp';

import { NewsletterSchema } from '@/containers/newsletter/index';

export const contactFormActions = async (
email: z.infer<typeof NewsletterSchema>['email'],
mergeFields: {
FNAME: string;
LNAME: string;
ORG_TYPE?: string | undefined;
ORG_TYPE_O?: string | undefined;
}
) => {
try {
await mailchimp.lists.addListMember('77ab6984cf', {
status: 'subscribed',
email_address: email,
merge_fields: {
...mergeFields,
},
});

return {
ok: true,
};
} catch (err) {
if (err instanceof Error) {
return {
ok: false,
message: err.message,
};
}

return {
ok: false,
message: 'Error sending contact form',
};
}
};

export default contactFormActions;

import { Resend } from 'resend';
import * as React from 'react';
import { ContactUsEmail } from 'components/contact/email-template';

const resend = new Resend(process.env.RESEND_API_KEY);

export async function POST(req: Request) {
const payload = await req.json();

try {
const { data, error } = await resend.emails.send({
from: '[email protected]',
to: payload.email,
subject: `Thank you for contacting us, ${payload.name}`,
react: ContactUsEmail(payload),
});

if (error) {
return Response.json({ error });
}

return Response.json({ data });
} catch (error) {
return Response.json({ error });
}
}
2 changes: 1 addition & 1 deletion src/components/contact/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use client';
'use client';

import { useCallback, useRef, useState } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion src/components/contextual/basemaps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { MouseEvent } from 'react';

import Image from 'next/image';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import { basemapAtom } from 'store/map';

Expand Down
2 changes: 1 addition & 1 deletion src/components/contextual/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ReactNode, useMemo } from 'react';

import Image, { StaticImageData } from 'next/image';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import { basemapAtom } from 'store/map';
import { basemapContextualAtom } from 'store/map-settings';
Expand Down
2 changes: 1 addition & 1 deletion src/components/contextual/contextual-basemaps.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useState } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import { activeLayersAtom } from 'store/layers';

Expand Down
2 changes: 1 addition & 1 deletion src/components/contextual/hi-res-extent-basemap.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useState } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import { activeLayersAtom } from 'store/layers';

Expand Down
2 changes: 1 addition & 1 deletion src/components/download-links/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import Icon from 'components/ui/icon';

Expand Down
2 changes: 1 addition & 1 deletion src/components/highlighted-places/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import Link from 'next/link';
import { useRouter } from 'next/router';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import {
useHighlightedPlaces,
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/controls/basemap-settings/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import Info from 'containers/datasets/contextual-layers/planet/info.mdx';
import Helper from 'containers/guide/helper';
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/controls/fullscreen/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';
import { Tooltip, TooltipContent, TooltipTrigger } from 'components/ui/tooltip';

import { fullScreenAtom } from 'store/map-settings';
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/controls/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Children, FC, PropsWithChildren } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import type { ControlsProps } from './types';

Expand Down
2 changes: 1 addition & 1 deletion src/components/map/controls/pitch-reset/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useCallback } from 'react';

import { useMap } from 'react-map-gl';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import Icon from 'components/ui/icon';

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 @@ -2,7 +2,7 @@ import { useCallback, useEffect, useState } from 'react';

import { useRouter } from 'next/router';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import { Dialog, DialogClose, DialogContent, DialogTrigger } from 'components/ui/dialog';
import Icon from 'components/ui/icon';
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/controls/zoom/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useCallback, MouseEvent } from 'react';

import { useMap } from 'react-map-gl';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import Icon from 'components/ui/icon';

Expand Down
2 changes: 1 addition & 1 deletion src/components/map/legend/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useMemo, Children, isValidElement } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import SortableList from './sortable/list';
import { LegendProps } from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/components/map/legend/sortable/item.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ReactElement, cloneElement } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import { useSortable } from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
Expand Down
2 changes: 1 addition & 1 deletion src/components/planet-date-select/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo, useCallback } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import { activeLayersAtom } from 'store/layers';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import { Slot } from '@radix-ui/react-slot';
import { cva, type VariantProps } from 'class-variance-authority';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/checkbox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import * as CheckboxPrimitive from '@radix-ui/react-checkbox';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/command/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HTMLAttributes } from 'react';
import { forwardRef, ElementRef, ComponentPropsWithoutRef } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import { DialogProps } from '@radix-ui/react-dialog';
import { Command as CommandPrimitive } from 'cmdk';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/dialog/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import * as DialogPrimitive from '@radix-ui/react-dialog';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/dropdown/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { forwardRef, ElementRef, ComponentPropsWithoutRef, HTMLAttributes } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/input/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/loading/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FC } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import cx from 'classnames';
import { motion, AnimatePresence } from 'framer-motion';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/popover/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import * as PopoverPrimitive from '@radix-ui/react-popover';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/radio-group/radio-group-item/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import * as RadioGroup from '@radix-ui/react-radio-group';
import { CgRadioCheck } from 'react-icons/cg';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/select-multi/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FC, useCallback, useEffect, useMemo, useState } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import { Listbox } from '@headlessui/react';
import { Float } from '@headlessui-float/react';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/slider/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import * as SliderPrimitive from '@radix-ui/react-slider';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/switch/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ReactNode } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import * as SwitchRadix from '@radix-ui/react-switch';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/tooltip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import * as TooltipPrimitive from '@radix-ui/react-tooltip';

Expand Down
2 changes: 1 addition & 1 deletion src/components/widget-controls/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo, useCallback } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import { activeLayersAtom } from 'store/layers';
import { mapSettingsAtom } from 'store/map-settings';
Expand Down
2 changes: 1 addition & 1 deletion src/containers/categories-menu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, type MouseEvent } from 'react';

import cn from 'lib/classnames';
import { cn } from 'lib/classnames';

import { activeLayersAtom } from 'store/layers';
import { activeCategoryAtom } from 'store/sidebar';
Expand Down
Loading

0 comments on commit d4743ae

Please sign in to comment.