Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LiaSolo committed Jun 5, 2024
1 parent f93f71f commit 2514e7b
Show file tree
Hide file tree
Showing 50 changed files with 110 additions and 122 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Button from '@components/Button';
import Icon from '@components/Icon';
import { NextRouter } from 'next/router';
import React from 'react';
import Button from '@components/Button';
import Icon from '@components/Icon';

const FormFooter = (router: NextRouter, onSubmit: () => Promise<void>) => (
<>
Expand Down
2 changes: 1 addition & 1 deletion web-app/client/src/components/Chart/ChartControls.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC } from 'react';
import Button from '@components/Button';
import Icon from '@components/Icon';
import { Text } from '@components/Inputs';
import { FC } from 'react';
import styles from './ChartControls.module.scss';

type Props = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import cn from 'classnames';
import { Dispatch, FC, SetStateAction, useState } from 'react';
import Button from '@components/Button';
import Icon from '@components/Icon';
import { Checkbox } from '@components/Inputs';
import cn from 'classnames';
import { Dispatch, FC, SetStateAction, useState } from 'react';
import styles from './ClusterOptions.module.scss';

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion web-app/client/src/components/Collapse/Collapse.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Icon from '@components/Icon';
import cn from 'classnames';
import { useState } from 'react';
import Icon from '@components/Icon';
import { FCWithChildren } from 'types/react';
import styles from './Collapse.module.scss';

Expand Down
18 changes: 10 additions & 8 deletions web-app/client/src/components/DatasetCard/DatasetCard.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import Icon from '@components/Icon';
import { useTaskUrlParams } from '@hooks/useTaskUrlParams';
import classNames from 'classnames';
import { formatDistance } from 'date-fns';
import { FC, PropsWithChildren, useState } from 'react';
import FilePropertiesModal from '@components/FilePropertiesModal';
import Icon from '@components/Icon';
import { useTaskUrlParams } from '@hooks/useTaskUrlParams';
import '@formatjs/intl-numberformat/polyfill';
import '@formatjs/intl-numberformat/locale-data/en';
import { AllowedDataset } from 'types/algorithms';
import styles from './DatasetCard.module.scss';
import FilePropertiesModal from '@components/FilePropertiesModal';

interface BaseCardProps extends PropsWithChildren {
isSelected?: boolean;
isDisabled?: boolean;
Expand Down Expand Up @@ -75,12 +76,13 @@ export const DatasetCard: FC<DatasetCardProps> = ({ file }) => {
>
<div className={styles.cardTitle}>
<p title={fileName}>{fileName}</p>
<Icon
name="threeDots"
size={20}
onClick={() => setIsOpen(true)}
<Icon name="threeDots" size={20} onClick={() => setIsOpen(true)} />
<FilePropertiesModal
isOpen={isOpen}
onClose={() => setIsOpen(false)}
fileID={file.fileID}
data={file}
/>
<FilePropertiesModal isOpen={isOpen} onClose={() => setIsOpen(false)} fileID={file.fileID} data={file} />
</div>
<div className={styles.cardDescription}>
<span>{descriptionList.join('\n')}</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { DefaultContext, useMutation, useQuery } from '@apollo/client';
import classNames from 'classnames';
import { FC, useCallback, useEffect, useRef, useState } from 'react';
import cardStyles from '@components/DatasetCard/DatasetCard.module.scss';
import FilePropertiesModal from '@components/FilePropertiesModal';
import Icon from '@components/Icon';
import ProgressBar, { Progress } from '@components/ProgressBar/ProgressBar';
import {
Expand All @@ -9,11 +12,8 @@ import {
import { UPLOAD_DATASET } from '@graphql/operations/mutations/uploadDataset';
import { getAlgorithmsConfig } from '@graphql/operations/queries/__generated__/getAlgorithmsConfig';
import { GET_ALGORITHMS_CONFIG } from '@graphql/operations/queries/getAlgorithmsConfig';
import classNames from 'classnames';
import { FC, useCallback, useEffect, useRef, useState } from 'react';
import { AllowedDataset } from 'types/algorithms';
import styles from './DatasetUploader.module.scss';
import FilePropertiesModal from '@components/FilePropertiesModal';

type Props = {
onUpload: (file: AllowedDataset) => void;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Icon from '@components/Icon';
import { useTaskContext } from '@components/TaskContext';
import { GeneralColumn } from '@utils/convertDependencies';
import classNames from 'classnames';
import _ from 'lodash';
import { FC, ReactElement } from 'react';
import Icon from '@components/Icon';
import { useTaskContext } from '@components/TaskContext';
import { GeneralColumn } from '@utils/convertDependencies';
import styles from './DependencyList.module.scss';

type Props = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useMutation } from '@apollo/client';
import { FC } from 'react';
import Button from '@components/Button';
import Icon from '@components/Icon';
import { useTaskContext } from '@components/TaskContext';
Expand All @@ -7,7 +8,6 @@ import {
downloadResultsVariables,
} from '@graphql/operations/mutations/__generated__/downloadResults';
import { DOWNLOAD_RESULTS } from '@graphql/operations/mutations/downloadResults';
import { FC } from 'react';
import { FileExtension, IntersectionFilter } from 'types/globalTypes';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Icon from '@components/Icon';
import cn from 'classnames';
import { FC, HTMLProps } from 'react';
import Icon from '@components/Icon';
import styles from './ExternalLink.module.scss';

const ExternalLink: FC<HTMLProps<HTMLAnchorElement>> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type Props = ModalProps &
);

const FilePropertiesModal: FC<Props> = ({ isOpen, onClose, ...props }) => {

return (
<ModalContainer isOpen={isOpen} onClose={onClose}>
<h4 className={styles.header}>File Properties</h4>
Expand Down
4 changes: 2 additions & 2 deletions web-app/client/src/components/FileStats/Alert/Alert.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Icon from '@components/Icon';
import colors from '@constants/colors';
import classNames from 'classnames';
import { FC, HTMLProps, ReactNode } from 'react';
import Icon from '@components/Icon';
import colors from '@constants/colors';
import styles from './Alert.module.scss';

type AlertVariant = 'info' | 'error' | 'success' | 'warning';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import classNames from 'classnames';
import { FC, HTMLProps } from 'react';
import { Collapse } from 'react-collapse';
import Button from '@components/Button';
import { Badge } from '@components/FileStats/Badge';
import { useToggle } from '@components/FileStats/hooks';
Expand All @@ -6,9 +9,6 @@ import { Paper } from '@components/FileStats/Paper';
import { StatsBlock } from '@components/FileStats/StatsBlock';
import Icon from '@components/Icon';
import { getFileStats_datasetInfo_statsInfo_stats as ColumnStats } from '@graphql/operations/queries/__generated__/getFileStats';
import classNames from 'classnames';
import { FC, HTMLProps } from 'react';
import { Collapse } from 'react-collapse';
import styles from './ColumnCard.module.scss';

type ColumnCardProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Button from '@components/Button';
import Icon from '@components/Icon';
import classNames from 'classnames';
import { ButtonHTMLAttributes, FC } from 'react';
import Button from '@components/Button';
import Icon from '@components/Icon';
import styles from './ModeButton.module.scss';

type ModeButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
Expand Down
6 changes: 3 additions & 3 deletions web-app/client/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import classNames from 'classnames';
import Link from 'next/link';
import { useEffect, useState } from 'react';
import Button from '@components/Button';
import Icon from '@components/Icon';
import LogInModal from '@components/LogInModal';
import NavBar from '@components/NavBar';
import SignUpModal from '@components/SignUpModal';
import { useAuthContext } from '@hooks/useAuthContext';
import classNames from 'classnames';
import { useEffect, useState } from 'react';
import styles from './Header.module.scss';
import Link from 'next/link';

const Header = () => {
const { user, signOut } = useAuthContext();
Expand Down
2 changes: 1 addition & 1 deletion web-app/client/src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ const Icon = <TName extends IconName>(
return icons[props.name](props);
};

export default Icon;
export default Icon;
2 changes: 1 addition & 1 deletion web-app/client/src/components/Icon/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default } from './Icon';
export type { IconName } from './Icon';
export type { IconName } from './Icon';
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
import ReactSelect, { Props as ReactSelectProps } from 'react-select';
import { InputPropsBase } from '@components/Inputs';
import Tooltip from '@components/Tooltip';
import { portalRoot } from '@constants/portalRoot';
import { Option } from 'types/inputs';
import customComponents, { colorStyles } from './customComponents';
import styles from './MultiSelect.module.scss';
import { portalRoot } from '@constants/portalRoot';

export type MultiSelectProps<TValue = string> = InputPropsBase &
ReactSelectProps<Option<TValue>, true> & {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import Icon from '@components/Icon';
import { InputPropsBase } from '@components/Inputs';
import badgeStyles from '@components/Inputs/MultiSelect/OptionBadge/OptionBadge.module.scss';
import cn from 'classnames';
import { ComponentType } from 'react';
import {
Expand All @@ -18,10 +15,13 @@ import {
OptionProps,
NoticeProps,
} from 'react-select';
import Icon from '@components/Icon';
import { InputPropsBase } from '@components/Inputs';
import badgeStyles from '@components/Inputs/MultiSelect/OptionBadge/OptionBadge.module.scss';
import { Option as OptionType } from 'types/inputs';
import { OptionWithBadges } from 'types/multiSelect';
import { OptionBadge } from './OptionBadge';
import styles from './MultiSelect.module.scss';
import { Option as OptionType } from 'types/inputs';

export const colorStyles: StylesConfig = {
control: () => ({}),
Expand Down
4 changes: 2 additions & 2 deletions web-app/client/src/components/Inputs/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
import ReactSelect, { Props as ReactSelectProps } from 'react-select';
import { InputPropsBase } from '@components/Inputs';
import Tooltip from '@components/Tooltip';
import { portalRoot } from '@constants/portalRoot';
import { Option } from 'types/inputs';
import customComponents from './customComponents';
import styles from './Select.module.scss';
import { portalRoot } from '@constants/portalRoot';

export type Props<TValue = string> = InputPropsBase &
ReactSelectProps<Option<TValue>, false> & {
Expand Down Expand Up @@ -49,7 +49,7 @@ const Select: ForwardRefRenderFunction<RefElement, Props> = (
ref={ref}
styles={{
menuPortal: (base) => {
return { ...base};
return { ...base };
},
}}
menuPortalTarget={portalRoot}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Icon from '@components/Icon';
import { InputPropsBase } from '@components/Inputs';
import cn from 'classnames';
import { ComponentType } from 'react';
import {
Expand All @@ -12,11 +10,11 @@ import {
SingleValueProps,
ValueContainerProps,
NoticeProps,
MenuProps,
} from 'react-select';
import Icon from '@components/Icon';
import { InputPropsBase } from '@components/Inputs';
import { Option as OptionType } from 'types/inputs';
import styles from './Select.module.scss';
import { FloatingPortal } from '@floating-ui/react';

const Control: ComponentType<
ControlProps<OptionType, false> & InputPropsBase
Expand Down
3 changes: 1 addition & 2 deletions web-app/client/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Header from '@components/Header';
import dynamic from 'next/dynamic';
import { NextSeo } from 'next-seo';
import Header from '@components/Header';
import { FCWithChildren } from 'types/react';
import styles from './Layout.module.scss';

Expand All @@ -9,7 +9,6 @@ const MobileBanner = dynamic(() => import('@components/MobileBanner'), {
});

const Layout: FCWithChildren = ({ children }) => {

return (
<>
<NextSeo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Button from '@components/Button';
import ModalContainer, { ModalProps } from '@components/ModalContainer';
import { FCWithChildren } from 'types/react';
import styles from './ListPropertiesModal.module.scss';
import { Dispatch, SetStateAction } from 'react';

interface Props extends ModalProps {
name: string;
Expand All @@ -11,18 +10,13 @@ interface Props extends ModalProps {

const ListPropertiesModal: FCWithChildren<Props> = ({
isOpen,
setIsOpen,
name,
onClose,
onApply,
children,
}) => {
return (
<ModalContainer
isOpen={isOpen}
setIsOpen={setIsOpen}
onClose={onClose}
>
<ModalContainer isOpen={isOpen} onClose={onClose}>
<h4 className={styles.title}>{name}</h4>
<div className={styles.inputs}>{children}</div>
<div className={styles.buttons}>
Expand Down
6 changes: 3 additions & 3 deletions web-app/client/src/components/Loader/Loader.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import cn from 'classnames';
import { useRouter } from 'next/router';
import { FC, useEffect } from 'react';
import Icon, { IconName } from '@components/Icon';
import { primitivePathnames } from '@constants/primitiveReportPathnames';
import useTaskState from '@hooks/useTaskState';
import getTaskStatusData from '@utils/getTaskStatusData';
import cn from 'classnames';
import { useRouter } from 'next/router';
import { FC, useEffect } from 'react';
import { PrimitiveType } from 'types/globalTypes';
import styles from './Loader.module.scss';

Expand Down
2 changes: 1 addition & 1 deletion web-app/client/src/components/LogInModal/LogInModal.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FC, useEffect, useState } from 'react';
import AuthSuccessModal from '@components/AuthSuccessModal';
import ModalContainer, { ModalProps } from '../ModalContainer';
import Code from './steps/Code';
import Email from './steps/Email';
import LogIn from './steps/LogIn';
import Password from './steps/Password';
import AuthSuccessModal from '@components/AuthSuccessModal';

const LogInModal: FC<ModalProps> = ({ isOpen, onClose }) => {
const [stage, setStage] = useState(1);
Expand Down
1 change: 0 additions & 1 deletion web-app/client/src/components/LogInModal/steps/LogIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useMutation } from '@apollo/client';
import { FC } from 'react';
import { useForm } from 'react-hook-form';
import isEmail from 'validator/lib/isEmail';
import isStrongPassword from 'validator/lib/isStrongPassword';
import Button from '@components/Button';
import { Text } from '@components/Inputs';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useForm } from 'react-hook-form';
import isStrongPassword from 'validator/lib/isStrongPassword';
import Button from '@components/Button';
import { Text } from '@components/Inputs';
import { passwordTooltip } from '@components/SignUpModal/steps/CoreInfo';
import {
changePassword,
changePasswordVariables,
Expand All @@ -12,7 +13,6 @@ import { CHANGE_PASSWORD } from '@graphql/operations/mutations/changePassword';
import { useAuthContext } from '@hooks/useAuthContext';
import hashPassword from '@utils/hashPassword';
import styles from '../LogInModal.module.scss';
import { passwordTooltip } from '@components/SignUpModal/steps/CoreInfo';

type Inputs = {
password: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Icon from '@components/Icon';
import { FC, useLayoutEffect, useReducer, useRef } from 'react';
import Icon from '@components/Icon';
import styles from './MobileBanner.module.scss';

const isMobile = () =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Icon from '@components/Icon';
import {
useFloating,
FloatingPortal,
Expand All @@ -9,10 +8,11 @@ import {
useInteractions,
useRole,
} from '@floating-ui/react';
import { FCWithChildren } from 'types/react';
import styles from './ModalContainer.module.scss';
import cn from 'classnames';
import Icon from '@components/Icon';
import { portalRoot } from '@constants/portalRoot';
import { FCWithChildren } from 'types/react';
import styles from './ModalContainer.module.scss';

export interface ModalProps {
onClose: () => void;
Expand Down
Loading

0 comments on commit 2514e7b

Please sign in to comment.