Skip to content

Commit

Permalink
chore(j-s): Stop importing React (#15806)
Browse files Browse the repository at this point in the history
* Stop importing React

* Stop importing React

* Stop importing React

* Stop importing React

* Stop importing React

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
oddsson and kodiakhq[bot] authored Aug 29, 2024
1 parent 77e96d5 commit fccaa6d
Show file tree
Hide file tree
Showing 213 changed files with 256 additions and 289 deletions.
1 change: 0 additions & 1 deletion apps/judicial-system/web/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import App, { AppContext, AppProps } from 'next/app'
import getConfig from 'next/config'
import Head from 'next/head'
Expand Down
1 change: 0 additions & 1 deletion apps/judicial-system/web/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import Document, { Head, Html, Main, NextScript } from 'next/document'

export default class MyDocument extends Document {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Dispatch, FC, SetStateAction } from 'react'
import { Dispatch, FC, SetStateAction } from 'react'
import { useIntl } from 'react-intl'
import { AnimatePresence } from 'framer-motion'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { motion } from 'framer-motion'

import { Box, Icon, IconMapIcon, Text } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'

import { AccordionItem, Box, Text } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'

import { AccordionItem } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'
import isSameDay from 'date-fns/isSameDay'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'

import { Accordion, AccordionItem, Text } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'

import { AccordionItem, Box, Text } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'

import { AccordionItem, Box, Text } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, PropsWithChildren } from 'react'
import { FC, PropsWithChildren } from 'react'

import { Box, Text } from '@island.is/island-ui/core'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import React from 'react'
import { IntlProvider } from 'react-intl'
import { ApolloClient, ApolloProvider, InMemoryCache } from '@apollo/client'
import { render, screen, within } from '@testing-library/react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext, useEffect, useState } from 'react'
import { useContext, useEffect, useState } from 'react'
import { useIntl } from 'react-intl'
import { AnimatePresence } from 'framer-motion'
import router from 'next/router'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'

import { Box, Text } from '@island.is/island-ui/core'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, PropsWithChildren } from 'react'
import { FC, PropsWithChildren } from 'react'
import cn from 'classnames'

import { TestSupport } from '@island.is/island-ui/utils'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { FC } from 'react'
import { FC, ReactNode } from 'react'

import { Box, Icon, IconMapIcon, Text } from '@island.is/island-ui/core'

import * as styles from './BlueBoxWithIcon.css'

export interface DataSection {
data: { title: string; value?: React.ReactNode }[]
data: { title: string; value?: ReactNode }[]
}

interface Props {
data: { title: string; value?: React.ReactNode }[]
data: { title: string; value?: ReactNode }[]
icon?: IconMapIcon
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'

import { Text } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'

import { Text } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { IntlProvider } from 'react-intl'
import { render, screen } from '@testing-library/react'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'

import { Box, Button, IconMapIcon, Text } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import cn from 'classnames'

import { IconMapIcon } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { MockedProvider } from '@apollo/client/testing'
import { render, screen } from '@testing-library/react'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'
import { AnimatePresence } from 'framer-motion'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { IntlShape, useIntl } from 'react-intl'
import flatMap from 'lodash/flatMap'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'

import { AlertMessage } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useState } from 'react'
import { FC, useState } from 'react'
import { IntlShape, useIntl } from 'react-intl'

import { Box, Input } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useContext } from 'react'
import { FC, useContext } from 'react'
import { useIntl } from 'react-intl'

import { Box, Text } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { MessageDescriptor, useIntl } from 'react-intl'

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Dispatch, FC, SetStateAction } from 'react'
import { Dispatch, FC, SetStateAction } from 'react'
import { useIntl } from 'react-intl'

import { Box, Input, Text, Tooltip } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'

import { Box, Text } from '@island.is/island-ui/core'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { Dispatch, FC, SetStateAction } from 'react'
import { useIntl } from 'react-intl'

import { Box, Text } from '@island.is/island-ui/core'
Expand All @@ -14,7 +14,7 @@ import { useCase } from '../../utils/hooks'

interface Props {
workingCase: Case
setWorkingCase: React.Dispatch<React.SetStateAction<Case>>
setWorkingCase: Dispatch<SetStateAction<Case>>
}

const ConclusionDraft: FC<Props> = ({ workingCase, setWorkingCase }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { fireEvent, render, screen } from '@testing-library/react'

import ContextMenu from '../ContextMenu/ContextMenu'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef, ReactElement } from 'react'
import { cloneElement, forwardRef, ReactElement } from 'react'
import { useIntl } from 'react-intl'
import cn from 'classnames'
import { Menu, MenuButton, MenuItem, useMenuState } from 'reakit/Menu'
Expand Down Expand Up @@ -98,9 +98,7 @@ const ContextMenu = forwardRef<HTMLElement, ContextMenuProps & TestSupport>(
{...disclosure.props}
dataTestId={dataTestId}
>
{(disclosureProps) =>
React.cloneElement(disclosure, disclosureProps)
}
{(disclosureProps) => cloneElement(disclosure, disclosureProps)}
</MenuButton>
) : (
<MenuButton as={Button} icon="add" {...menu} dataTestId={dataTestId}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useCallback, useContext, useState } from 'react'
import { FC, useCallback, useContext, useState } from 'react'
import { useIntl } from 'react-intl'

import { IconMapIcon } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, SetStateAction, useEffect, useState } from 'react'
import { FC, SetStateAction, useEffect, useState } from 'react'
import { useIntl } from 'react-intl'
import compareAsc from 'date-fns/compareAsc'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Dispatch, FC, useState } from 'react'
import { Dispatch, FC, SetStateAction, useState } from 'react'
import { useIntl } from 'react-intl'
import Select, {
ClearIndicatorProps,
Expand Down Expand Up @@ -27,7 +27,7 @@ import * as styles from './CourtDocuments.css'

interface Props {
workingCase: Case
setWorkingCase: Dispatch<React.SetStateAction<Case>>
setWorkingCase: Dispatch<SetStateAction<Case>>
}

const CourtDocuments: FC<Props> = ({ workingCase, setWorkingCase }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { IntlProvider } from 'react-intl'
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
Expand Down
6 changes: 3 additions & 3 deletions apps/judicial-system/web/src/components/DateTime/DateTime.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useEffect, useState } from 'react'
import { ChangeEvent, FC, FocusEvent, useEffect, useState } from 'react'
import { useIntl } from 'react-intl'

import { DatePicker, Input } from '@island.is/island-ui/core'
Expand Down Expand Up @@ -117,7 +117,7 @@ const DateTime: FC<Props> = ({
)
}

const onTimeChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const onTimeChange = (event: ChangeEvent<HTMLInputElement>) => {
const newTime = event.target.value

setCurrentTime(newTime)
Expand All @@ -133,7 +133,7 @@ const DateTime: FC<Props> = ({
sendToParent(currentDate, newTime)
}

const onTimeBlur = (event: React.FocusEvent<HTMLInputElement>) => {
const onTimeBlur = (event: FocusEvent<HTMLInputElement>) => {
const time = event.target.value

const validations: Validation[] = ['empty', 'time-format']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useState } from 'react'
import { FC, useState } from 'react'

import { Box, RadioButton } from '@island.is/island-ui/core'
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useContext, useState } from 'react'
import { Dispatch, FC, SetStateAction, useContext, useState } from 'react'
import { useIntl } from 'react-intl'

import { Box, RadioButton, Text, Tooltip } from '@island.is/island-ui/core'
Expand All @@ -24,7 +24,7 @@ import { defenderInfo } from './DefenderInfo.strings'

interface Props {
workingCase: Case
setWorkingCase: React.Dispatch<React.SetStateAction<Case>>
setWorkingCase: Dispatch<SetStateAction<Case>>
}

const DefenderInfo: FC<Props> = ({ workingCase, setWorkingCase }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {
import {
Dispatch,
FC,
SetStateAction,
useCallback,
Expand Down Expand Up @@ -43,7 +44,7 @@ interface PropertyValidation {
validations: Validation[]
errorMessageHandler: {
errorMessage: string
setErrorMessage: React.Dispatch<React.SetStateAction<string>>
setErrorMessage: Dispatch<SetStateAction<string>>
}
}

Expand Down Expand Up @@ -167,7 +168,7 @@ const DefenderInput: FC<Props> = ({
defendantId: string,
property: InputType,
value: string,
setWorkingCase: React.Dispatch<SetStateAction<Case>>,
setWorkingCase: Dispatch<SetStateAction<Case>>,
) => {
let newValue = value
const propertyValidation = propertyValidations(property)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { useIntl } from 'react-intl'

import { AlertMessage, Box } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {
import {
createContext,
FC,
PropsWithChildren,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'

import { Modal } from '@island.is/judicial-system-web/src/components'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, PropsWithChildren } from 'react'
import { FC, PropsWithChildren } from 'react'

import { Box } from '@island.is/island-ui/core'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { useIntl } from 'react-intl'
import { useWindowSize } from 'react-use'
import cn from 'classnames'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, {
import {
createContext,
Dispatch,
ReactNode,
SetStateAction,
useCallback,
useContext,
useEffect,
Expand Down Expand Up @@ -35,7 +37,7 @@ type ProviderState =

interface FormProvider {
workingCase: Case
setWorkingCase: React.Dispatch<React.SetStateAction<Case>>
setWorkingCase: Dispatch<SetStateAction<Case>>
isLoadingWorkingCase: boolean
caseNotFound: boolean
isCaseUpToDate: boolean
Expand Down
8 changes: 1 addition & 7 deletions apps/judicial-system/web/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import React, {
FC,
PropsWithChildren,
useContext,
useEffect,
useState,
} from 'react'
import { FC, PropsWithChildren, useContext, useEffect, useState } from 'react'
import { useIntl } from 'react-intl'
import getConfig from 'next/config'
import Link from 'next/link'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'
import { AnimatePresence, motion } from 'framer-motion'

import { Icon, Text, Tooltip } from '@island.is/island-ui/core'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react'
import { FC } from 'react'

import { Box, Icon, IconMapIcon, Text } from '@island.is/island-ui/core'
import { Colors } from '@island.is/island-ui/theme'
Expand Down
Loading

0 comments on commit fccaa6d

Please sign in to comment.