diff options
author | Quentin Gliech <quentingliech@gmail.com> | 2022-02-16 10:32:20 +0100 |
---|---|---|
committer | Quentin Gliech <quentingliech@gmail.com> | 2022-02-16 10:32:20 +0100 |
commit | bce4d095e16fb33d181b29aa1d3476037c0c873a (patch) | |
tree | 5906465bec4fec179597cd707a710bad08583cd8 | |
parent | ce50269639988e39fe4e27cc8c309a9d5c75c958 (diff) | |
download | git-bug-bce4d095e16fb33d181b29aa1d3476037c0c873a.tar.gz |
webui: replace React imports
44 files changed, 34 insertions, 60 deletions
diff --git a/webui/src/App.tsx b/webui/src/App.tsx index 04da655a..87cb08fb 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { Route, Switch } from 'react-router'; import Layout from './components/Header'; diff --git a/webui/src/components/Author.tsx b/webui/src/components/Author.tsx index 593b5d36..b9f95aae 100644 --- a/webui/src/components/Author.tsx +++ b/webui/src/components/Author.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { Link as RouterLink } from 'react-router-dom'; import MAvatar from '@material-ui/core/Avatar'; diff --git a/webui/src/components/BackToListButton.tsx b/webui/src/components/BackToListButton.tsx index 41e1d68a..8bc75491 100644 --- a/webui/src/components/BackToListButton.tsx +++ b/webui/src/components/BackToListButton.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { Link } from 'react-router-dom'; import Button from '@material-ui/core/Button'; diff --git a/webui/src/components/BugTitleForm/BugTitleForm.tsx b/webui/src/components/BugTitleForm/BugTitleForm.tsx index 2a3c4db0..6007680f 100644 --- a/webui/src/components/BugTitleForm/BugTitleForm.tsx +++ b/webui/src/components/BugTitleForm/BugTitleForm.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import { useState } from 'react'; import { Link } from 'react-router-dom'; import { Button, makeStyles, Typography } from '@material-ui/core'; diff --git a/webui/src/components/CloseBugButton/index.tsx b/webui/src/components/CloseBugButton/index.tsx index bb154ea7..77b93e7f 100644 --- a/webui/src/components/CloseBugButton/index.tsx +++ b/webui/src/components/CloseBugButton/index.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import Button from '@material-ui/core/Button'; import CircularProgress from '@material-ui/core/CircularProgress'; import { makeStyles, Theme } from '@material-ui/core/styles'; diff --git a/webui/src/components/CloseBugWithCommentButton/index.tsx b/webui/src/components/CloseBugWithCommentButton/index.tsx index cbf3f757..9663ec3f 100644 --- a/webui/src/components/CloseBugWithCommentButton/index.tsx +++ b/webui/src/components/CloseBugWithCommentButton/index.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import Button from '@material-ui/core/Button'; import CircularProgress from '@material-ui/core/CircularProgress'; import { makeStyles, Theme } from '@material-ui/core/styles'; diff --git a/webui/src/components/CommentInput/CommentInput.tsx b/webui/src/components/CommentInput/CommentInput.tsx index babd495c..07322a22 100644 --- a/webui/src/components/CommentInput/CommentInput.tsx +++ b/webui/src/components/CommentInput/CommentInput.tsx @@ -1,4 +1,5 @@ -import React, { useState, useEffect } from 'react'; +import { useState, useEffect } from 'react'; +import * as React from 'react'; import { Typography } from '@material-ui/core'; import Tab from '@material-ui/core/Tab'; diff --git a/webui/src/components/Content/AnchorTag.tsx b/webui/src/components/Content/AnchorTag.tsx index bbd45bc8..0ded34b6 100644 --- a/webui/src/components/Content/AnchorTag.tsx +++ b/webui/src/components/Content/AnchorTag.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { Link } from 'react-router-dom'; import { makeStyles } from '@material-ui/core/styles'; diff --git a/webui/src/components/Content/BlockQuoteTag.tsx b/webui/src/components/Content/BlockQuoteTag.tsx index c7c250f5..d9674b5d 100644 --- a/webui/src/components/Content/BlockQuoteTag.tsx +++ b/webui/src/components/Content/BlockQuoteTag.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { makeStyles } from '@material-ui/core/styles'; diff --git a/webui/src/components/Content/ImageTag.tsx b/webui/src/components/Content/ImageTag.tsx index 94004f0e..2e12ee45 100644 --- a/webui/src/components/Content/ImageTag.tsx +++ b/webui/src/components/Content/ImageTag.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { makeStyles } from '@material-ui/styles'; diff --git a/webui/src/components/Content/PreTag.tsx b/webui/src/components/Content/PreTag.tsx index ecb573e0..4601cc2d 100644 --- a/webui/src/components/Content/PreTag.tsx +++ b/webui/src/components/Content/PreTag.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { makeStyles } from '@material-ui/styles'; diff --git a/webui/src/components/Content/index.tsx b/webui/src/components/Content/index.tsx index ccb412c1..9bf9ff7a 100644 --- a/webui/src/components/Content/index.tsx +++ b/webui/src/components/Content/index.tsx @@ -1,4 +1,5 @@ -import React, { createElement, Fragment, useEffect, useState } from 'react'; +import { createElement, Fragment, useEffect, useState } from 'react'; +import * as React from 'react'; import rehypeReact from 'rehype-react'; import gemoji from 'remark-gemoji'; import html from 'remark-html'; diff --git a/webui/src/components/Date.tsx b/webui/src/components/Date.tsx index f9e0a0b2..edc531b0 100644 --- a/webui/src/components/Date.tsx +++ b/webui/src/components/Date.tsx @@ -1,5 +1,4 @@ import moment from 'moment'; -import React from 'react'; import Moment from 'react-moment'; import Tooltip from '@material-ui/core/Tooltip/Tooltip'; diff --git a/webui/src/components/Header/Header.tsx b/webui/src/components/Header/Header.tsx index 866e52db..f9053f76 100644 --- a/webui/src/components/Header/Header.tsx +++ b/webui/src/components/Header/Header.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { Link, useLocation } from 'react-router-dom'; import AppBar from '@material-ui/core/AppBar'; diff --git a/webui/src/components/Header/index.tsx b/webui/src/components/Header/index.tsx index 42a0cfc1..e4dc8d19 100644 --- a/webui/src/components/Header/index.tsx +++ b/webui/src/components/Header/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import CssBaseline from '@material-ui/core/CssBaseline'; diff --git a/webui/src/components/Identity/CurrentIdentity.tsx b/webui/src/components/Identity/CurrentIdentity.tsx index 2d62dcdb..7be2a5f0 100644 --- a/webui/src/components/Identity/CurrentIdentity.tsx +++ b/webui/src/components/Identity/CurrentIdentity.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { useState, useRef } from 'react'; import { Link as RouterLink } from 'react-router-dom'; import { @@ -37,8 +37,8 @@ const CurrentIdentity = () => { const classes = useStyles(); const { loading, error, data } = useCurrentIdentityQuery(); - const [open, setOpen] = React.useState(false); - const anchorRef = React.useRef<HTMLButtonElement>(null); + const [open, setOpen] = useState(false); + const anchorRef = useRef<HTMLButtonElement>(null); if (error || loading || !data?.repository?.userIdentity) return null; diff --git a/webui/src/components/IfLoggedIn/IfLoggedIn.tsx b/webui/src/components/IfLoggedIn/IfLoggedIn.tsx index ce120da1..965135d9 100644 --- a/webui/src/components/IfLoggedIn/IfLoggedIn.tsx +++ b/webui/src/components/IfLoggedIn/IfLoggedIn.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { useCurrentIdentityQuery } from '../Identity/CurrentIdentity.generated'; diff --git a/webui/src/components/Label.tsx b/webui/src/components/Label.tsx index a1d3c6f9..05f6c279 100644 --- a/webui/src/components/Label.tsx +++ b/webui/src/components/Label.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { Chip } from '@material-ui/core'; import { common } from '@material-ui/core/colors'; import { diff --git a/webui/src/components/ReopenBugButton/index.tsx b/webui/src/components/ReopenBugButton/index.tsx index e62c58df..2433bc60 100644 --- a/webui/src/components/ReopenBugButton/index.tsx +++ b/webui/src/components/ReopenBugButton/index.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import Button from '@material-ui/core/Button'; import CircularProgress from '@material-ui/core/CircularProgress'; diff --git a/webui/src/components/ReopenBugWithCommentButton/index.tsx b/webui/src/components/ReopenBugWithCommentButton/index.tsx index 817054b8..54e8b1e7 100644 --- a/webui/src/components/ReopenBugWithCommentButton/index.tsx +++ b/webui/src/components/ReopenBugWithCommentButton/index.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import Button from '@material-ui/core/Button'; import CircularProgress from '@material-ui/core/CircularProgress'; diff --git a/webui/src/components/Themer.tsx b/webui/src/components/Themer.tsx index edf1f352..063587e3 100644 --- a/webui/src/components/Themer.tsx +++ b/webui/src/components/Themer.tsx @@ -1,4 +1,5 @@ -import React, { createContext, useContext, useState } from 'react'; +import { createContext, useContext, useState } from 'react'; +import * as React from 'react'; import { ThemeProvider } from '@material-ui/core'; import IconButton from '@material-ui/core/IconButton'; diff --git a/webui/src/index.tsx b/webui/src/index.tsx index d3591e1a..d203eb19 100644 --- a/webui/src/index.tsx +++ b/webui/src/index.tsx @@ -1,5 +1,4 @@ import { ApolloProvider } from '@apollo/client'; -import React from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter } from 'react-router-dom'; diff --git a/webui/src/pages/bug/Bug.tsx b/webui/src/pages/bug/Bug.tsx index b32b0948..99f43064 100644 --- a/webui/src/pages/bug/Bug.tsx +++ b/webui/src/pages/bug/Bug.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { makeStyles } from '@material-ui/core/styles'; import BugTitleForm from 'src/components/BugTitleForm/BugTitleForm'; diff --git a/webui/src/pages/bug/BugQuery.tsx b/webui/src/pages/bug/BugQuery.tsx index 5d459c42..fd0fb9d4 100644 --- a/webui/src/pages/bug/BugQuery.tsx +++ b/webui/src/pages/bug/BugQuery.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { RouteComponentProps } from 'react-router-dom'; import CircularProgress from '@material-ui/core/CircularProgress'; diff --git a/webui/src/pages/bug/CommentForm.tsx b/webui/src/pages/bug/CommentForm.tsx index 6d917889..3634f43e 100644 --- a/webui/src/pages/bug/CommentForm.tsx +++ b/webui/src/pages/bug/CommentForm.tsx @@ -1,4 +1,5 @@ -import React, { useState, useRef } from 'react'; +import { useState, useRef } from 'react'; +import * as React from 'react'; import Button from '@material-ui/core/Button'; import Paper from '@material-ui/core/Paper'; diff --git a/webui/src/pages/bug/EditCommentForm.tsx b/webui/src/pages/bug/EditCommentForm.tsx index 8fa659b3..77453941 100644 --- a/webui/src/pages/bug/EditCommentForm.tsx +++ b/webui/src/pages/bug/EditCommentForm.tsx @@ -1,4 +1,5 @@ -import React, { useState, useRef } from 'react'; +import { useState, useRef } from 'react'; +import * as React from 'react'; import Button from '@material-ui/core/Button'; import Paper from '@material-ui/core/Paper'; diff --git a/webui/src/pages/bug/LabelChange.tsx b/webui/src/pages/bug/LabelChange.tsx index 868d8c9b..8c88faf2 100644 --- a/webui/src/pages/bug/LabelChange.tsx +++ b/webui/src/pages/bug/LabelChange.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { Typography } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; diff --git a/webui/src/pages/bug/Message.tsx b/webui/src/pages/bug/Message.tsx index 51087faa..450d5902 100644 --- a/webui/src/pages/bug/Message.tsx +++ b/webui/src/pages/bug/Message.tsx @@ -1,4 +1,5 @@ -import React, { useState } from 'react'; +import { useState } from 'react'; +import * as React from 'react'; import IconButton from '@material-ui/core/IconButton'; import Paper from '@material-ui/core/Paper'; diff --git a/webui/src/pages/bug/MessageHistoryDialog.tsx b/webui/src/pages/bug/MessageHistoryDialog.tsx index 84848cce..c1302196 100644 --- a/webui/src/pages/bug/MessageHistoryDialog.tsx +++ b/webui/src/pages/bug/MessageHistoryDialog.tsx @@ -1,5 +1,5 @@ import moment from 'moment'; -import React from 'react'; +import * as React from 'react'; import Moment from 'react-moment'; import MuiAccordion from '@material-ui/core/Accordion'; diff --git a/webui/src/pages/bug/SetStatus.tsx b/webui/src/pages/bug/SetStatus.tsx index f231b917..87f16267 100644 --- a/webui/src/pages/bug/SetStatus.tsx +++ b/webui/src/pages/bug/SetStatus.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { Typography } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; diff --git a/webui/src/pages/bug/SetTitle.tsx b/webui/src/pages/bug/SetTitle.tsx index 057062f7..39657532 100644 --- a/webui/src/pages/bug/SetTitle.tsx +++ b/webui/src/pages/bug/SetTitle.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { Typography } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; diff --git a/webui/src/pages/bug/Timeline.tsx b/webui/src/pages/bug/Timeline.tsx index 60459a53..1e17fd0a 100644 --- a/webui/src/pages/bug/Timeline.tsx +++ b/webui/src/pages/bug/Timeline.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { makeStyles } from '@material-ui/core/styles'; import { BugFragment } from './Bug.generated'; diff --git a/webui/src/pages/bug/TimelineQuery.tsx b/webui/src/pages/bug/TimelineQuery.tsx index d66c665b..52e8a827 100644 --- a/webui/src/pages/bug/TimelineQuery.tsx +++ b/webui/src/pages/bug/TimelineQuery.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import CircularProgress from '@material-ui/core/CircularProgress'; import { BugFragment } from './Bug.generated'; diff --git a/webui/src/pages/bug/labels/LabelMenu.tsx b/webui/src/pages/bug/labels/LabelMenu.tsx index 645f472c..2c30fcc2 100644 --- a/webui/src/pages/bug/labels/LabelMenu.tsx +++ b/webui/src/pages/bug/labels/LabelMenu.tsx @@ -1,4 +1,5 @@ -import React, { useEffect, useRef, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; +import * as React from 'react'; import { IconButton } from '@material-ui/core'; import Menu from '@material-ui/core/Menu'; diff --git a/webui/src/pages/identity/BugList.tsx b/webui/src/pages/identity/BugList.tsx index fbddb0fe..c053d1cf 100644 --- a/webui/src/pages/identity/BugList.tsx +++ b/webui/src/pages/identity/BugList.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { Card, Divider, Link, Typography } from '@material-ui/core'; import CircularProgress from '@material-ui/core/CircularProgress'; import { makeStyles } from '@material-ui/core/styles'; diff --git a/webui/src/pages/identity/Identity.tsx b/webui/src/pages/identity/Identity.tsx index 5170eeea..786b40d8 100644 --- a/webui/src/pages/identity/Identity.tsx +++ b/webui/src/pages/identity/Identity.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { Link as RouterLink } from 'react-router-dom'; import { Link, Paper, Typography } from '@material-ui/core'; diff --git a/webui/src/pages/identity/IdentityQuery.tsx b/webui/src/pages/identity/IdentityQuery.tsx index 964a9bac..762c17cc 100644 --- a/webui/src/pages/identity/IdentityQuery.tsx +++ b/webui/src/pages/identity/IdentityQuery.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { RouteComponentProps } from 'react-router-dom'; import CircularProgress from '@material-ui/core/CircularProgress'; diff --git a/webui/src/pages/list/BugRow.tsx b/webui/src/pages/list/BugRow.tsx index 68a3b299..b3380dd7 100644 --- a/webui/src/pages/list/BugRow.tsx +++ b/webui/src/pages/list/BugRow.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import * as React from 'react'; import { Link } from 'react-router-dom'; import TableCell from '@material-ui/core/TableCell/TableCell'; diff --git a/webui/src/pages/list/Filter.tsx b/webui/src/pages/list/Filter.tsx index 496fb3ba..e85ae488 100644 --- a/webui/src/pages/list/Filter.tsx +++ b/webui/src/pages/list/Filter.tsx @@ -1,6 +1,7 @@ import clsx from 'clsx'; import { LocationDescriptor } from 'history'; -import React, { useRef, useState, useEffect } from 'react'; +import { useRef, useState, useEffect } from 'react'; +import * as React from 'react'; import { Link } from 'react-router-dom'; import Menu from '@material-ui/core/Menu'; diff --git a/webui/src/pages/list/FilterToolbar.tsx b/webui/src/pages/list/FilterToolbar.tsx index 0c7a9e4f..9620bd97 100644 --- a/webui/src/pages/list/FilterToolbar.tsx +++ b/webui/src/pages/list/FilterToolbar.tsx @@ -1,6 +1,6 @@ import { pipe } from '@arrows/composition'; import { LocationDescriptor } from 'history'; -import React from 'react'; +import * as React from 'react'; import Toolbar from '@material-ui/core/Toolbar'; import { makeStyles } from '@material-ui/core/styles'; diff --git a/webui/src/pages/list/List.tsx b/webui/src/pages/list/List.tsx index c1cae122..11760509 100644 --- a/webui/src/pages/list/List.tsx +++ b/webui/src/pages/list/List.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import Table from '@material-ui/core/Table/Table'; import TableBody from '@material-ui/core/TableBody/TableBody'; diff --git a/webui/src/pages/list/ListQuery.tsx b/webui/src/pages/list/ListQuery.tsx index c2f71ef0..8dd9668e 100644 --- a/webui/src/pages/list/ListQuery.tsx +++ b/webui/src/pages/list/ListQuery.tsx @@ -1,6 +1,7 @@ import { ApolloError } from '@apollo/client'; import { pipe } from '@arrows/composition'; -import React, { useState, useEffect, useRef } from 'react'; +import { useState, useEffect, useRef } from 'react'; +import * as React from 'react'; import { useLocation, useHistory, Link } from 'react-router-dom'; import { Button, FormControl, Menu, MenuItem } from '@material-ui/core'; diff --git a/webui/src/pages/new/NewBugPage.tsx b/webui/src/pages/new/NewBugPage.tsx index cdec3558..902a94bc 100644 --- a/webui/src/pages/new/NewBugPage.tsx +++ b/webui/src/pages/new/NewBugPage.tsx @@ -1,4 +1,4 @@ -import React, { FormEvent, useState } from 'react'; +import { FormEvent, useState } from 'react'; import { useHistory } from 'react-router-dom'; import { Button, Paper } from '@material-ui/core'; diff --git a/webui/src/pages/notfound/NotFoundPage.tsx b/webui/src/pages/notfound/NotFoundPage.tsx index 2c6f6854..2fb2a1bb 100644 --- a/webui/src/pages/notfound/NotFoundPage.tsx +++ b/webui/src/pages/notfound/NotFoundPage.tsx @@ -1,5 +1,3 @@ -import React from 'react'; - import { makeStyles } from '@material-ui/core/styles'; import BackToListButton from '../../components/BackToListButton'; |