diff --git a/src/settings/RealTimeUpdatesSettings.tsx b/src/settings/RealTimeUpdatesSettings.tsx index e2424e5a..f9cccbce 100644 --- a/src/settings/RealTimeUpdatesSettings.tsx +++ b/src/settings/RealTimeUpdatesSettings.tsx @@ -1,6 +1,6 @@ import { FormGroup, Input } from 'reactstrap'; import classNames from 'classnames'; -import ToggleSwitch from '../utils/ToggleSwitch'; +import { ToggleSwitch } from '../utils/ToggleSwitch'; import { SimpleCard } from '../utils/SimpleCard'; import { FormText } from '../utils/forms/FormText'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; diff --git a/src/settings/ShortUrlCreationSettings.tsx b/src/settings/ShortUrlCreationSettings.tsx index a369e90f..d5523550 100644 --- a/src/settings/ShortUrlCreationSettings.tsx +++ b/src/settings/ShortUrlCreationSettings.tsx @@ -1,7 +1,7 @@ import { FC, ReactNode } from 'react'; import { DropdownItem, FormGroup } from 'reactstrap'; import { SimpleCard } from '../utils/SimpleCard'; -import ToggleSwitch from '../utils/ToggleSwitch'; +import { ToggleSwitch } from '../utils/ToggleSwitch'; import { DropdownBtn } from '../utils/DropdownBtn'; import { FormText } from '../utils/forms/FormText'; import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup'; diff --git a/src/settings/UserInterfaceSettings.tsx b/src/settings/UserInterfaceSettings.tsx index 5ca2e462..e21b3460 100644 --- a/src/settings/UserInterfaceSettings.tsx +++ b/src/settings/UserInterfaceSettings.tsx @@ -2,7 +2,7 @@ import { FC } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSun, faMoon } from '@fortawesome/free-solid-svg-icons'; import { SimpleCard } from '../utils/SimpleCard'; -import ToggleSwitch from '../utils/ToggleSwitch'; +import { ToggleSwitch } from '../utils/ToggleSwitch'; import { changeThemeInMarkup, Theme } from '../utils/theme'; import { Settings, UiSettings } from './reducers/settings'; import './UserInterfaceSettings.scss'; diff --git a/src/short-urls/ShortUrlForm.tsx b/src/short-urls/ShortUrlForm.tsx index 23406833..d8537e27 100644 --- a/src/short-urls/ShortUrlForm.tsx +++ b/src/short-urls/ShortUrlForm.tsx @@ -7,7 +7,7 @@ import DateInput, { DateInputProps } from '../utils/DateInput'; import { supportsCrawlableVisits, supportsForwardQuery } from '../utils/helpers/features'; import { SimpleCard } from '../utils/SimpleCard'; import { handleEventPreventingDefault, hasValue, OptionalString } from '../utils/utils'; -import Checkbox from '../utils/Checkbox'; +import { Checkbox } from '../utils/Checkbox'; import { SelectedServer } from '../servers/data'; import { TagsSelectorProps } from '../tags/helpers/TagsSelector'; import { DomainSelectorProps } from '../domains/DomainSelector'; diff --git a/src/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx b/src/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx index 85654d24..8d933df5 100644 --- a/src/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx +++ b/src/short-urls/helpers/ShortUrlFormCheckboxGroup.tsx @@ -1,5 +1,5 @@ import { ChangeEvent, FC, PropsWithChildren } from 'react'; -import Checkbox from '../../utils/Checkbox'; +import { Checkbox } from '../../utils/Checkbox'; import { InfoTooltip } from '../../utils/InfoTooltip'; type ShortUrlFormCheckboxGroupProps = PropsWithChildren<{ diff --git a/src/utils/Checkbox.tsx b/src/utils/Checkbox.tsx index de13b008..6a589dbf 100644 --- a/src/utils/Checkbox.tsx +++ b/src/utils/Checkbox.tsx @@ -1,6 +1,4 @@ import { FC } from 'react'; import BooleanControl, { BooleanControlProps } from './BooleanControl'; -const Checkbox: FC = (props) => ; - -export default Checkbox; +export const Checkbox: FC = (props) => ; diff --git a/src/utils/ToggleSwitch.tsx b/src/utils/ToggleSwitch.tsx index e5b30b0e..7b86b370 100644 --- a/src/utils/ToggleSwitch.tsx +++ b/src/utils/ToggleSwitch.tsx @@ -1,6 +1,4 @@ import { FC } from 'react'; import BooleanControl, { BooleanControlProps } from './BooleanControl'; -const ToggleSwitch: FC = (props) => ; - -export default ToggleSwitch; +export const ToggleSwitch: FC = (props) => ; diff --git a/src/visits/DomainVisits.tsx b/src/visits/DomainVisits.tsx index b0bdca5f..2283ad39 100644 --- a/src/visits/DomainVisits.tsx +++ b/src/visits/DomainVisits.tsx @@ -8,7 +8,7 @@ import { Topics } from '../mercure/helpers/Topics'; import { useGoBack } from '../utils/helpers/hooks'; import { toApiParams } from './types/helpers'; import { NormalizedVisit } from './types'; -import VisitsStats from './VisitsStats'; +import { VisitsStats } from './VisitsStats'; import VisitsHeader from './VisitsHeader'; export interface DomainVisitsProps extends CommonVisitsProps { diff --git a/src/visits/NonOrphanVisits.tsx b/src/visits/NonOrphanVisits.tsx index 2ebfe913..2c2cbe4f 100644 --- a/src/visits/NonOrphanVisits.tsx +++ b/src/visits/NonOrphanVisits.tsx @@ -3,7 +3,7 @@ import { ShlinkVisitsParams } from '../api/types'; import { Topics } from '../mercure/helpers/Topics'; import { useGoBack } from '../utils/helpers/hooks'; import { ReportExporter } from '../common/services/ReportExporter'; -import VisitsStats from './VisitsStats'; +import { VisitsStats } from './VisitsStats'; import { NormalizedVisit, VisitsInfo, VisitsParams } from './types'; import { CommonVisitsProps } from './types/CommonVisitsProps'; import { toApiParams } from './types/helpers'; diff --git a/src/visits/OrphanVisits.tsx b/src/visits/OrphanVisits.tsx index bc2ee1d1..45723ec2 100644 --- a/src/visits/OrphanVisits.tsx +++ b/src/visits/OrphanVisits.tsx @@ -3,7 +3,7 @@ import { ShlinkVisitsParams } from '../api/types'; import { Topics } from '../mercure/helpers/Topics'; import { useGoBack } from '../utils/helpers/hooks'; import { ReportExporter } from '../common/services/ReportExporter'; -import VisitsStats from './VisitsStats'; +import { VisitsStats } from './VisitsStats'; import { NormalizedVisit, OrphanVisitType, VisitsInfo, VisitsParams } from './types'; import { CommonVisitsProps } from './types/CommonVisitsProps'; import { toApiParams } from './types/helpers'; diff --git a/src/visits/ShortUrlVisits.tsx b/src/visits/ShortUrlVisits.tsx index 55323aec..748e8221 100644 --- a/src/visits/ShortUrlVisits.tsx +++ b/src/visits/ShortUrlVisits.tsx @@ -9,7 +9,7 @@ import { useGoBack } from '../utils/helpers/hooks'; import { ReportExporter } from '../common/services/ReportExporter'; import { ShortUrlVisits as ShortUrlVisitsState } from './reducers/shortUrlVisits'; import ShortUrlVisitsHeader from './ShortUrlVisitsHeader'; -import VisitsStats from './VisitsStats'; +import { VisitsStats } from './VisitsStats'; import { NormalizedVisit, VisitsParams } from './types'; import { CommonVisitsProps } from './types/CommonVisitsProps'; import { toApiParams } from './types/helpers'; diff --git a/src/visits/TagVisits.tsx b/src/visits/TagVisits.tsx index 74018ec5..afacca7f 100644 --- a/src/visits/TagVisits.tsx +++ b/src/visits/TagVisits.tsx @@ -7,7 +7,7 @@ import { useGoBack } from '../utils/helpers/hooks'; import { ReportExporter } from '../common/services/ReportExporter'; import { TagVisits as TagVisitsState } from './reducers/tagVisits'; import TagVisitsHeader from './TagVisitsHeader'; -import VisitsStats from './VisitsStats'; +import { VisitsStats } from './VisitsStats'; import { NormalizedVisit } from './types'; import { CommonVisitsProps } from './types/CommonVisitsProps'; import { toApiParams } from './types/helpers'; diff --git a/src/visits/VisitsStats.tsx b/src/visits/VisitsStats.tsx index 59885d5f..cb716261 100644 --- a/src/visits/VisitsStats.tsx +++ b/src/visits/VisitsStats.tsx @@ -17,7 +17,7 @@ import { supportsBotVisits } from '../utils/helpers/features'; import { prettify } from '../utils/helpers/numbers'; import { NavPillItem, NavPills } from '../utils/NavPills'; import { ExportBtn } from '../utils/ExportBtn'; -import LineChartCard from './charts/LineChartCard'; +import { LineChartCard } from './charts/LineChartCard'; import VisitsTable from './VisitsTable'; import { NormalizedOrphanVisit, NormalizedVisit, VisitsFilter, VisitsInfo, VisitsParams } from './types'; import OpenMapModalBtn from './helpers/OpenMapModalBtn'; @@ -55,7 +55,7 @@ const sections: Record = { let selectedBar: string | undefined; -const VisitsStats: FC = ({ +export const VisitsStats: FC = ({ children, visitsInfo, getVisits, @@ -325,5 +325,3 @@ const VisitsStats: FC = ({ ); }; - -export default VisitsStats; diff --git a/src/visits/charts/LineChartCard.tsx b/src/visits/charts/LineChartCard.tsx index 335dd742..039afce5 100644 --- a/src/visits/charts/LineChartCard.tsx +++ b/src/visits/charts/LineChartCard.tsx @@ -26,7 +26,7 @@ import { NormalizedVisit, Stats } from '../types'; import { fillTheGaps } from '../../utils/helpers/visits'; import { useToggle } from '../../utils/helpers/hooks'; import { rangeOf } from '../../utils/utils'; -import ToggleSwitch from '../../utils/ToggleSwitch'; +import { ToggleSwitch } from '../../utils/ToggleSwitch'; import { prettify } from '../../utils/helpers/numbers'; import { pointerOnHover, renderChartLabel } from '../../utils/helpers/charts'; import { HIGHLIGHTED_COLOR, MAIN_COLOR } from '../../utils/theme'; @@ -166,7 +166,7 @@ const chartElementAtEvent = ( } }; -const LineChartCard = ( +export const LineChartCard = ( { title, visits, highlightedVisits, highlightedLabel = 'Selected', setSelectedVisits }: LineChartCardProps, ) => { const [step, setStep] = useState( @@ -266,5 +266,3 @@ const LineChartCard = ( ); }; - -export default LineChartCard; diff --git a/test/settings/RealTimeUpdatesSettings.test.tsx b/test/settings/RealTimeUpdatesSettings.test.tsx index bd7c908a..ec86541a 100644 --- a/test/settings/RealTimeUpdatesSettings.test.tsx +++ b/test/settings/RealTimeUpdatesSettings.test.tsx @@ -7,7 +7,7 @@ import { Settings, } from '../../src/settings/reducers/settings'; import RealTimeUpdatesSettings from '../../src/settings/RealTimeUpdatesSettings'; -import ToggleSwitch from '../../src/utils/ToggleSwitch'; +import { ToggleSwitch } from '../../src/utils/ToggleSwitch'; import { LabeledFormGroup } from '../../src/utils/forms/LabeledFormGroup'; describe('', () => { diff --git a/test/settings/UserInterfaceSettings.test.tsx b/test/settings/UserInterfaceSettings.test.tsx index 48bd7f43..ce0945c2 100644 --- a/test/settings/UserInterfaceSettings.test.tsx +++ b/test/settings/UserInterfaceSettings.test.tsx @@ -4,7 +4,7 @@ import { faMoon, faSun } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Settings, UiSettings } from '../../src/settings/reducers/settings'; import { UserInterfaceSettings } from '../../src/settings/UserInterfaceSettings'; -import ToggleSwitch from '../../src/utils/ToggleSwitch'; +import { ToggleSwitch } from '../../src/utils/ToggleSwitch'; import { Theme } from '../../src/utils/theme'; describe('', () => { diff --git a/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx b/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx index da7aec6c..aa564849 100644 --- a/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx +++ b/test/short-urls/helpers/ShortUrlFormCheckboxGroup.test.tsx @@ -1,6 +1,6 @@ import { shallow } from 'enzyme'; import { ShortUrlFormCheckboxGroup } from '../../../src/short-urls/helpers/ShortUrlFormCheckboxGroup'; -import Checkbox from '../../../src/utils/Checkbox'; +import { Checkbox } from '../../../src/utils/Checkbox'; import { InfoTooltip } from '../../../src/utils/InfoTooltip'; describe('', () => { diff --git a/test/utils/Checkbox.test.tsx b/test/utils/Checkbox.test.tsx index e98390f0..be173718 100644 --- a/test/utils/Checkbox.test.tsx +++ b/test/utils/Checkbox.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import Checkbox from '../../src/utils/Checkbox'; +import { Checkbox } from '../../src/utils/Checkbox'; describe('', () => { it.each([['foo'], ['bar'], ['baz']])('includes extra class names when provided', (className) => { diff --git a/test/visits/OrphanVisits.test.tsx b/test/visits/OrphanVisits.test.tsx index b9b284d2..87129f32 100644 --- a/test/visits/OrphanVisits.test.tsx +++ b/test/visits/OrphanVisits.test.tsx @@ -3,7 +3,7 @@ import { Mock } from 'ts-mockery'; import { OrphanVisits as createOrphanVisits } from '../../src/visits/OrphanVisits'; import { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; import { VisitsInfo } from '../../src/visits/types'; -import VisitsStats from '../../src/visits/VisitsStats'; +import { VisitsStats } from '../../src/visits/VisitsStats'; import { Settings } from '../../src/settings/reducers/settings'; import { ReportExporter } from '../../src/common/services/ReportExporter'; import { SelectedServer } from '../../src/servers/data'; diff --git a/test/visits/ShortUrlVisits.test.tsx b/test/visits/ShortUrlVisits.test.tsx index f4cfc604..33713113 100644 --- a/test/visits/ShortUrlVisits.test.tsx +++ b/test/visits/ShortUrlVisits.test.tsx @@ -5,7 +5,7 @@ import createShortUrlVisits, { ShortUrlVisitsProps } from '../../src/visits/Shor import ShortUrlVisitsHeader from '../../src/visits/ShortUrlVisitsHeader'; import { ShortUrlVisits as ShortUrlVisitsState } from '../../src/visits/reducers/shortUrlVisits'; import { ShortUrlDetail } from '../../src/short-urls/reducers/shortUrlDetail'; -import VisitsStats from '../../src/visits/VisitsStats'; +import { VisitsStats } from '../../src/visits/VisitsStats'; import { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; import { ReportExporter } from '../../src/common/services/ReportExporter'; diff --git a/test/visits/TagVisits.test.tsx b/test/visits/TagVisits.test.tsx index b95e7be4..965d1ad1 100644 --- a/test/visits/TagVisits.test.tsx +++ b/test/visits/TagVisits.test.tsx @@ -4,7 +4,7 @@ import createTagVisits, { TagVisitsProps } from '../../src/visits/TagVisits'; import TagVisitsHeader from '../../src/visits/TagVisitsHeader'; import ColorGenerator from '../../src/utils/services/ColorGenerator'; import { TagVisits as TagVisitsStats } from '../../src/visits/reducers/tagVisits'; -import VisitsStats from '../../src/visits/VisitsStats'; +import { VisitsStats } from '../../src/visits/VisitsStats'; import { MercureBoundProps } from '../../src/mercure/helpers/boundToMercureHub'; import { ReportExporter } from '../../src/common/services/ReportExporter'; diff --git a/test/visits/VisitsStats.test.tsx b/test/visits/VisitsStats.test.tsx index 8c999008..2c6fbf1c 100644 --- a/test/visits/VisitsStats.test.tsx +++ b/test/visits/VisitsStats.test.tsx @@ -3,10 +3,10 @@ import { Progress } from 'reactstrap'; import { sum } from 'ramda'; import { Mock } from 'ts-mockery'; import { Route } from 'react-router-dom'; -import VisitStats from '../../src/visits/VisitsStats'; +import { VisitsStats } from '../../src/visits/VisitsStats'; import Message from '../../src/utils/Message'; import { Visit, VisitsInfo } from '../../src/visits/types'; -import LineChartCard from '../../src/visits/charts/LineChartCard'; +import { LineChartCard } from '../../src/visits/charts/LineChartCard'; import VisitsTable from '../../src/visits/VisitsTable'; import { Result } from '../../src/utils/Result'; import { Settings } from '../../src/settings/reducers/settings'; @@ -24,7 +24,7 @@ describe('', () => { const createComponent = (visitsInfo: Partial) => { wrapper = shallow( - (visitsInfo)} cancelGetVisits={() => {}} diff --git a/test/visits/charts/LineChartCard.test.tsx b/test/visits/charts/LineChartCard.test.tsx index 03e77933..e77511d9 100644 --- a/test/visits/charts/LineChartCard.test.tsx +++ b/test/visits/charts/LineChartCard.test.tsx @@ -3,8 +3,8 @@ import { CardHeader, DropdownItem } from 'reactstrap'; import { Line } from 'react-chartjs-2'; import { formatISO, subDays, subMonths, subYears } from 'date-fns'; import { Mock } from 'ts-mockery'; -import LineChartCard from '../../../src/visits/charts/LineChartCard'; -import ToggleSwitch from '../../../src/utils/ToggleSwitch'; +import { LineChartCard } from '../../../src/visits/charts/LineChartCard'; +import { ToggleSwitch } from '../../../src/utils/ToggleSwitch'; import { NormalizedVisit } from '../../../src/visits/types'; import { prettify } from '../../../src/utils/helpers/numbers'; import { pointerOnHover, renderChartLabel } from '../../../src/utils/helpers/charts';