From 578a7e2556ab581f9cdc90240956b029a2f9fbd9 Mon Sep 17 00:00:00 2001 From: Kyle Holmberg Date: Fri, 21 Jun 2024 04:53:18 +0700 Subject: [PATCH] resolve build errors --- components/Modal/Modal.tsx | 2 +- components/Modal/__stories__/Modal.stories.tsx | 4 ++-- components/OutboundLink/OutboundLink.tsx | 2 +- components/Pagination/Pagination.tsx | 5 +++-- .../Pagination/PaginationItem/PaginationItem.tsx | 3 ++- components/Press/PressLinks/PressLinks.tsx | 2 +- components/Press/index.ts | 6 +++--- .../__stories__/DonateSection.stories.tsx | 4 ++-- components/Timeline/Timeline.tsx | 2 +- .../UpgradeBrowserOverlay/UpgradeBrowserOverlay.tsx | 2 -- pages/join/index.tsx | 2 +- pages/team.tsx | 12 ++++++++---- types/files.d.ts | 6 ++---- 13 files changed, 27 insertions(+), 25 deletions(-) diff --git a/components/Modal/Modal.tsx b/components/Modal/Modal.tsx index 51622c07e..b2889df00 100644 --- a/components/Modal/Modal.tsx +++ b/components/Modal/Modal.tsx @@ -12,7 +12,7 @@ export interface ModalPropsType { /** * Function that is called when the user clicks the close button. */ - onRequestClose: (previousValue?: boolean) => void; + onRequestClose?: () => void; /** * Applies a label for the screen reader. */ diff --git a/components/Modal/__stories__/Modal.stories.tsx b/components/Modal/__stories__/Modal.stories.tsx index e258055e6..b4780872c 100644 --- a/components/Modal/__stories__/Modal.stories.tsx +++ b/components/Modal/__stories__/Modal.stories.tsx @@ -1,6 +1,6 @@ import { Meta, StoryObj } from '@storybook/react'; import { useState } from 'react'; -import { isChromatic } from 'chromatic/isChromatic'; +import isChromatic from 'chromatic/isChromatic'; import { Modal } from '../Modal'; import { descriptions } from '@/common/constants/descriptions'; import { Button } from '@/components/Buttons/Button/Button'; @@ -35,7 +35,7 @@ export const Default: ModalStoryType = { setIsDemoModalOpen(!prevValue)} + onRequestClose={() => setIsDemoModalOpen(prevValue => !prevValue)} /> ); diff --git a/components/OutboundLink/OutboundLink.tsx b/components/OutboundLink/OutboundLink.tsx index ac857025a..0cb402fbe 100644 --- a/components/OutboundLink/OutboundLink.tsx +++ b/components/OutboundLink/OutboundLink.tsx @@ -1,4 +1,4 @@ -import classNames from 'node_modules/classnames/index'; +import classNames from 'classnames'; import { gtag } from '@/common/utils/thirdParty/gtag'; import ExternalLinkIcon from '@/public/static/images/icons/FontAwesome/external-link-square-alt-solid.svg'; import { ScreenReaderOnly } from '@/components/ScreenReaderOnly/ScreenReaderOnly'; diff --git a/components/Pagination/Pagination.tsx b/components/Pagination/Pagination.tsx index 424330dd9..5a19cb8b3 100644 --- a/components/Pagination/Pagination.tsx +++ b/components/Pagination/Pagination.tsx @@ -1,5 +1,6 @@ -import { PREV_PAGE_BUTTON, NEXT_PAGE_BUTTON } from '../../common/constants/testIDs'; +import { ParsedUrlQueryInput } from 'node:querystring'; import { PaginationItem } from './PaginationItem/PaginationItem'; +import { PREV_PAGE_BUTTON, NEXT_PAGE_BUTTON } from '@/common/constants/testIDs'; import LeftAngleIcon from '@/public/static/images/icons/FontAwesome/angle-left-solid.svg'; import RightAngleIcon from '@/public/static/images/icons/FontAwesome/angle-right-solid.svg'; @@ -15,7 +16,7 @@ export interface PaginationPropsType { /** * Sets the URL path. */ - query: Record; + query: ParsedUrlQueryInput; /** * Sets the total number of pages. */ diff --git a/components/Pagination/PaginationItem/PaginationItem.tsx b/components/Pagination/PaginationItem/PaginationItem.tsx index 0e762acd5..8fd381987 100644 --- a/components/Pagination/PaginationItem/PaginationItem.tsx +++ b/components/Pagination/PaginationItem/PaginationItem.tsx @@ -1,3 +1,4 @@ +import { ParsedUrlQueryInput } from 'node:querystring'; import Link from 'next/link'; import omit from 'lodash/omit'; import classNames from 'classnames'; @@ -21,7 +22,7 @@ export interface PaginationItemPropsType { * Sets styles to indicate the current item is selected. */ isCurrent?: boolean; - query?: Record; + query?: ParsedUrlQueryInput; value?: number; } diff --git a/components/Press/PressLinks/PressLinks.tsx b/components/Press/PressLinks/PressLinks.tsx index fd15e0b88..df6d338fc 100644 --- a/components/Press/PressLinks/PressLinks.tsx +++ b/components/Press/PressLinks/PressLinks.tsx @@ -1,8 +1,8 @@ import * as Tabs from '@radix-ui/react-tabs'; -import { objectKeys } from 'utils/types'; import * as Articles from './Articles'; import styles from './PressLinks.module.css'; import { OutboundLink } from '@/components/OutboundLink/OutboundLink'; +import { objectKeys } from '@/utils/types'; export function PressLinks() { return ( diff --git a/components/Press/index.ts b/components/Press/index.ts index 47a3ffa1f..994d311a4 100644 --- a/components/Press/index.ts +++ b/components/Press/index.ts @@ -1,5 +1,5 @@ -import Photos from './PressPhotos/PressPhotos'; -import Videos from './PressVideos/PressVideos'; -import Links from './PressLinks/PressLinks'; +import { PressPhotos as Photos } from './PressPhotos/PressPhotos'; +import { PressVideos as Videos } from './PressVideos/PressVideos'; +import { PressLinks as Links } from './PressLinks/PressLinks'; export { Photos, Videos, Links }; diff --git a/components/ReusableSections/DonateSection/__stories__/DonateSection.stories.tsx b/components/ReusableSections/DonateSection/__stories__/DonateSection.stories.tsx index f5d68673d..9c5dc967e 100644 --- a/components/ReusableSections/DonateSection/__stories__/DonateSection.stories.tsx +++ b/components/ReusableSections/DonateSection/__stories__/DonateSection.stories.tsx @@ -1,8 +1,8 @@ -import { React } from 'react'; import { Meta, StoryObj } from '@storybook/react'; +import { FC } from 'react'; import { DonateSection } from '../DonateSection'; -type DonateSectionStoryType = StoryObj; +type DonateSectionStoryType = StoryObj; const meta: Meta = { title: 'ReusableSections/DonateSection', diff --git a/components/Timeline/Timeline.tsx b/components/Timeline/Timeline.tsx index 6330f31ff..1b263dc19 100644 --- a/components/Timeline/Timeline.tsx +++ b/components/Timeline/Timeline.tsx @@ -1,7 +1,7 @@ -import { objectKeys } from 'utils/types'; import { historyData } from './historyData'; import styles from './Timeline.module.css'; import { TimelineEvent } from './TimelineEvent/TimelineEvent'; +import { objectKeys } from '@/utils/types'; export function Timeline() { return ( diff --git a/components/UpgradeBrowserOverlay/UpgradeBrowserOverlay.tsx b/components/UpgradeBrowserOverlay/UpgradeBrowserOverlay.tsx index 0018bcd5d..0c30db472 100644 --- a/components/UpgradeBrowserOverlay/UpgradeBrowserOverlay.tsx +++ b/components/UpgradeBrowserOverlay/UpgradeBrowserOverlay.tsx @@ -1,4 +1,3 @@ -import noop from 'lodash/noop'; import Image from 'next/legacy/image'; import styles from './UpgradeBrowserOverlay.module.css'; import { Modal } from '@/components/Modal/Modal'; @@ -32,7 +31,6 @@ export function UpgradeBrowserOverlay() { return ( } - image={{ - source: imageSource, - alt: `Headshot of ${name}`, - }} + image={ + imageSource + ? { + source: imageSource, + alt: `Headshot of ${name}`, + } + : undefined + } > {description} diff --git a/types/files.d.ts b/types/files.d.ts index 5852bed70..e946098a2 100644 --- a/types/files.d.ts +++ b/types/files.d.ts @@ -1,10 +1,8 @@ declare module '*.svg' { import { SVGProps, ReactSVGElement } from 'react'; - export const ReactComponent: (props?: SVGProps) => ReactSVGElement; - - const filePath: string; + const ReactComponent: (props?: SVGProps) => ReactSVGElement; // eslint-disable-next-line import/no-default-export - export default filePath; + export default ReactComponent; }