chore: refactor

This commit is contained in:
Marvin9
2020-10-15 09:16:39 +05:30
parent ba056b1ba8
commit 8f0608a5ed
34 changed files with 72 additions and 263 deletions
@@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BackstageTheme } from '@backstage/theme';
import React, { useState, useMemo, FC, ReactNode } from 'react';
import { useLocalStorage, useAsync } from 'react-use';
import { useNavigate } from 'react-router-dom';
import { Grid, Button, useTheme } from '@material-ui/core';
import { Grid, Button } from '@material-ui/core';
import Alert from '@material-ui/lab/Alert';
import Pagination from '@material-ui/lab/Pagination';
import {
@@ -41,7 +40,6 @@ import { createAuditRouteRef } from '../../plugin';
export const LIMIT = 10;
const AuditList: FC<{}> = () => {
const backstageTheme = useTheme<BackstageTheme>();
const [dismissedStored] = useLocalStorage(LIGHTHOUSE_INTRO_LOCAL_STORAGE);
const [dismissed, setDismissed] = useState(dismissedStored);
@@ -95,11 +93,7 @@ const AuditList: FC<{}> = () => {
}
return (
<Page
theme={backstageTheme.getPageTheme({
themeId: 'tool',
})}
>
<Page themeId="tool">
<Header
title="Lighthouse"
subtitle="Website audits powered by Lighthouse"
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BackstageTheme } from '@backstage/theme';
import React, { useState, useEffect, ReactNode, FC } from 'react';
import {
Link,
@@ -31,7 +30,6 @@ import {
Button,
ListItemIcon,
ListItemText,
useTheme,
} from '@material-ui/core';
import Alert from '@material-ui/lab/Alert';
import {
@@ -194,13 +192,8 @@ export const AuditViewContent: FC<{}> = () => {
};
const ConnectedAuditView = () => {
const backstageTheme = useTheme<BackstageTheme>();
return (
<Page
theme={backstageTheme.getPageTheme({
themeId: 'tool',
})}
>
<Page themeId="tool">
<Header
title="Lighthouse"
subtitle="Website audits powered by Lighthouse"
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BackstageTheme } from '@backstage/theme';
import React, { useState, useCallback, FC } from 'react';
import { useNavigate } from 'react-router-dom';
import {
@@ -24,7 +23,6 @@ import {
ListItem,
MenuItem,
TextField,
useTheme,
} from '@material-ui/core';
import {
errorApiRef,
@@ -171,13 +169,8 @@ export const CreateAuditContent: FC<{}> = () => {
};
const CreateAudit = () => {
const backstageTheme = useTheme<BackstageTheme>();
return (
<Page
theme={backstageTheme.getPageTheme({
themeId: 'tool',
})}
>
<Page themeId="tool">
<Header
title="Lighthouse"
subtitle="Website audits powered by Lighthouse"