Rename "CustomButtonIcon" to "CustomIconButton"
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
import type { ButtonProps } from '@mui/material/Button';
|
import type { ButtonProps } from '@mui/material/Button';
|
||||||
import Button from '@mui/material/Button';
|
import Button from '@mui/material/Button';
|
||||||
|
|
||||||
export const CustomButtonIcon = <C extends React.ElementType>({
|
export const CustomIconButton = <C extends React.ElementType>({
|
||||||
children,
|
children,
|
||||||
...props
|
...props
|
||||||
}: ButtonProps<C, { component?: C }>) => (
|
}: ButtonProps<C, { component?: C }>) => (
|
||||||
@@ -46,7 +46,7 @@ import type {
|
|||||||
MangaTrackRecordInfo,
|
MangaTrackRecordInfo,
|
||||||
} from '@/features/manga/Manga.types.ts';
|
} from '@/features/manga/Manga.types.ts';
|
||||||
import { applyStyles } from '@/base/utils/ApplyStyles.ts';
|
import { applyStyles } from '@/base/utils/ApplyStyles.ts';
|
||||||
import { CustomButtonIcon } from '@/base/components/buttons/CustomButtonIcon.tsx';
|
import { CustomIconButton } from '@/base/components/buttons/CustomIconButton.tsx';
|
||||||
import { Sources } from '@/features/source/services/Sources.ts';
|
import { Sources } from '@/features/source/services/Sources.ts';
|
||||||
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
|
import type { SourceIdInfo } from '@/features/source/Source.types.ts';
|
||||||
import { Thumbnail } from '@/features/manga/components/details/Thumbnail.tsx';
|
import { Thumbnail } from '@/features/manga/components/details/Thumbnail.tsx';
|
||||||
@@ -152,7 +152,7 @@ const OpenSourceButton = ({ url }: { url?: string | null }) => {
|
|||||||
return (
|
return (
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<CustomTooltip title={t`Open in browser`} disabled={!url}>
|
<CustomTooltip title={t`Open in browser`} disabled={!url}>
|
||||||
<CustomButtonIcon
|
<CustomIconButton
|
||||||
size="medium"
|
size="medium"
|
||||||
disabled={!url}
|
disabled={!url}
|
||||||
component={Link}
|
component={Link}
|
||||||
@@ -162,10 +162,10 @@ const OpenSourceButton = ({ url }: { url?: string | null }) => {
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
>
|
>
|
||||||
<IconBrowser />
|
<IconBrowser />
|
||||||
</CustomButtonIcon>
|
</CustomIconButton>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
<CustomTooltip title={t`Open in WebView`} disabled={!url}>
|
<CustomTooltip title={t`Open in WebView`} disabled={!url}>
|
||||||
<CustomButtonIcon
|
<CustomIconButton
|
||||||
size="medium"
|
size="medium"
|
||||||
disabled={!url}
|
disabled={!url}
|
||||||
component={Link}
|
component={Link}
|
||||||
@@ -175,7 +175,7 @@ const OpenSourceButton = ({ url }: { url?: string | null }) => {
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
>
|
>
|
||||||
<IconWebView />
|
<IconWebView />
|
||||||
</CustomButtonIcon>
|
</CustomIconButton>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
import type { MangaIdInfo } from '@/features/manga/Manga.types.ts';
|
||||||
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';
|
import { MediaQuery } from '@/base/utils/MediaQuery.tsx';
|
||||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||||
import { CustomButtonIcon } from '@/base/components/buttons/CustomButtonIcon.tsx';
|
import { CustomIconButton } from '@/base/components/buttons/CustomIconButton.tsx';
|
||||||
import { MigrationManager } from '@/features/migration/MigrationManager.ts';
|
import { MigrationManager } from '@/features/migration/MigrationManager.ts';
|
||||||
import IconButton from '@mui/material/IconButton';
|
import IconButton from '@mui/material/IconButton';
|
||||||
import { useLingui } from '@lingui/react/macro';
|
import { useLingui } from '@lingui/react/macro';
|
||||||
@@ -65,7 +65,7 @@ export const MigrationEntrySearchExcludeActions = ({
|
|||||||
)}
|
)}
|
||||||
{!isMigrating && !isExpanded && (
|
{!isMigrating && !isExpanded && (
|
||||||
<CustomTooltip title={t`Manual search`}>
|
<CustomTooltip title={t`Manual search`}>
|
||||||
<CustomButtonIcon
|
<CustomIconButton
|
||||||
sx={{
|
sx={{
|
||||||
flexGrow: Number(!otherResultsCount),
|
flexGrow: Number(!otherResultsCount),
|
||||||
}}
|
}}
|
||||||
@@ -74,12 +74,12 @@ export const MigrationEntrySearchExcludeActions = ({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<SearchIcon />
|
<SearchIcon />
|
||||||
</CustomButtonIcon>
|
</CustomIconButton>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
)}
|
)}
|
||||||
{!isMigrating && hasSelectedMatch && (
|
{!isMigrating && hasSelectedMatch && (
|
||||||
<CustomTooltip title={isExcluded ? t`Include` : t`Exclude`}>
|
<CustomTooltip title={isExcluded ? t`Include` : t`Exclude`}>
|
||||||
<CustomButtonIcon
|
<CustomIconButton
|
||||||
sx={{
|
sx={{
|
||||||
flexGrow: Number(!otherResultsCount),
|
flexGrow: Number(!otherResultsCount),
|
||||||
}}
|
}}
|
||||||
@@ -90,19 +90,19 @@ export const MigrationEntrySearchExcludeActions = ({
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
{isExcluded ? <AddCircleOutlineOutlinedIcon /> : <RemoveCircleOutlineOutlinedIcon />}
|
{isExcluded ? <AddCircleOutlineOutlinedIcon /> : <RemoveCircleOutlineOutlinedIcon />}
|
||||||
</CustomButtonIcon>
|
</CustomIconButton>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
)}
|
)}
|
||||||
{isAbortable && (
|
{isAbortable && (
|
||||||
<CustomTooltip title={t`Abort`}>
|
<CustomTooltip title={t`Abort`}>
|
||||||
<CustomButtonIcon
|
<CustomIconButton
|
||||||
sx={{
|
sx={{
|
||||||
flexGrow: Number(!otherResultsCount),
|
flexGrow: Number(!otherResultsCount),
|
||||||
}}
|
}}
|
||||||
onClick={() => MigrationManager.abortEntry(mangaId)}
|
onClick={() => MigrationManager.abortEntry(mangaId)}
|
||||||
>
|
>
|
||||||
<CancelOutlinedIcon />
|
<CancelOutlinedIcon />
|
||||||
</CustomButtonIcon>
|
</CustomIconButton>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
)}
|
)}
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|||||||
@@ -10,20 +10,20 @@ import type { ComponentProps } from 'react';
|
|||||||
import KeyboardArrowLeftIcon from '@mui/icons-material/KeyboardArrowLeft';
|
import KeyboardArrowLeftIcon from '@mui/icons-material/KeyboardArrowLeft';
|
||||||
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
|
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
|
||||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||||
import { CustomButtonIcon } from '@/base/components/buttons/CustomButtonIcon.tsx';
|
import { CustomIconButton } from '@/base/components/buttons/CustomIconButton.tsx';
|
||||||
|
|
||||||
export const ReaderNavBarDesktopNextPreviousButton = ({
|
export const ReaderNavBarDesktopNextPreviousButton = ({
|
||||||
title,
|
title,
|
||||||
type,
|
type,
|
||||||
disabled,
|
disabled,
|
||||||
...customIconButtonProps
|
...customIconButtonProps
|
||||||
}: Omit<ComponentProps<typeof CustomButtonIcon>, 'children'> & {
|
}: Omit<ComponentProps<typeof CustomIconButton>, 'children'> & {
|
||||||
title: string;
|
title: string;
|
||||||
type: 'previous' | 'next';
|
type: 'previous' | 'next';
|
||||||
}) => (
|
}) => (
|
||||||
<CustomTooltip title={title} disabled={disabled}>
|
<CustomTooltip title={title} disabled={disabled}>
|
||||||
<CustomButtonIcon sx={{ flexBasis: '15%' }} variant="contained" disabled={disabled} {...customIconButtonProps}>
|
<CustomIconButton sx={{ flexBasis: '15%' }} variant="contained" disabled={disabled} {...customIconButtonProps}>
|
||||||
{type === 'previous' ? <KeyboardArrowLeftIcon /> : <KeyboardArrowRightIcon />}
|
{type === 'previous' ? <KeyboardArrowLeftIcon /> : <KeyboardArrowRightIcon />}
|
||||||
</CustomButtonIcon>
|
</CustomIconButton>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
READER_PAGE_SCALE_MODE_VALUES,
|
READER_PAGE_SCALE_MODE_VALUES,
|
||||||
} from '@/features/reader/settings/ReaderSettings.constants.tsx';
|
} from '@/features/reader/settings/ReaderSettings.constants.tsx';
|
||||||
import type { MultiValueButtonDefaultableProps } from '@/base/Base.types.ts';
|
import type { MultiValueButtonDefaultableProps } from '@/base/Base.types.ts';
|
||||||
import { CustomButtonIcon } from '@/base/components/buttons/CustomButtonIcon.tsx';
|
import { CustomIconButton } from '@/base/components/buttons/CustomIconButton.tsx';
|
||||||
|
|
||||||
export const ReaderNavBarDesktopPageScale = ({
|
export const ReaderNavBarDesktopPageScale = ({
|
||||||
pageScaleMode,
|
pageScaleMode,
|
||||||
@@ -52,14 +52,14 @@ export const ReaderNavBarDesktopPageScale = ({
|
|||||||
/>
|
/>
|
||||||
{READER_PAGE_SCALE_MODE_TO_SCALING_ALLOWED[pageScaleMode.value] && (
|
{READER_PAGE_SCALE_MODE_TO_SCALING_ALLOWED[pageScaleMode.value] && (
|
||||||
<CustomTooltip title={t`Stretch small pages`}>
|
<CustomTooltip title={t`Stretch small pages`}>
|
||||||
<CustomButtonIcon
|
<CustomIconButton
|
||||||
onClick={() => updateSetting('shouldStretchPage', !shouldStretchPage.value)}
|
onClick={() => updateSetting('shouldStretchPage', !shouldStretchPage.value)}
|
||||||
sx={{ px: undefined }}
|
sx={{ px: undefined }}
|
||||||
variant="contained"
|
variant="contained"
|
||||||
color={shouldStretchPage.value ? 'secondary' : 'primary'}
|
color={shouldStretchPage.value ? 'secondary' : 'primary'}
|
||||||
>
|
>
|
||||||
<FitScreenIcon />
|
<FitScreenIcon />
|
||||||
</CustomButtonIcon>
|
</CustomIconButton>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import { getErrorMessage } from '@/lib/HelperFunctions.ts';
|
|||||||
import { applyStyles } from '@/base/utils/ApplyStyles.ts';
|
import { applyStyles } from '@/base/utils/ApplyStyles.ts';
|
||||||
import type { TrackerIdInfo, TTrackerBind } from '@/features/tracker/Tracker.types.ts';
|
import type { TrackerIdInfo, TTrackerBind } from '@/features/tracker/Tracker.types.ts';
|
||||||
import { Tracker } from '@/features/tracker/Tracker.types.ts';
|
import { Tracker } from '@/features/tracker/Tracker.types.ts';
|
||||||
import { CustomButtonIcon } from '@/base/components/buttons/CustomButtonIcon.tsx';
|
import { CustomIconButton } from '@/base/components/buttons/CustomIconButton.tsx';
|
||||||
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
import { CustomTooltip } from '@/base/components/CustomTooltip.tsx';
|
||||||
import { STABLE_EMPTY_ARRAY } from '@/base/Base.constants.ts';
|
import { STABLE_EMPTY_ARRAY } from '@/base/Base.constants.ts';
|
||||||
|
|
||||||
@@ -97,14 +97,14 @@ const TrackButton = ({
|
|||||||
</Button>
|
</Button>
|
||||||
{supportsPrivateTracking && (
|
{supportsPrivateTracking && (
|
||||||
<CustomTooltip title={t`Track privately`} disabled={bindTrackerMutation.loading}>
|
<CustomTooltip title={t`Track privately`} disabled={bindTrackerMutation.loading}>
|
||||||
<CustomButtonIcon
|
<CustomIconButton
|
||||||
disabled={bindTrackerMutation.loading}
|
disabled={bindTrackerMutation.loading}
|
||||||
sx={{ flexBasis: '10%', maxWidth: '100px' }}
|
sx={{ flexBasis: '10%', maxWidth: '100px' }}
|
||||||
variant="contained"
|
variant="contained"
|
||||||
onClick={() => trackManga(true)}
|
onClick={() => trackManga(true)}
|
||||||
>
|
>
|
||||||
<VisibilityOffIcon />
|
<VisibilityOffIcon />
|
||||||
</CustomButtonIcon>
|
</CustomIconButton>
|
||||||
</CustomTooltip>
|
</CustomTooltip>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
Reference in New Issue
Block a user