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