Skip to content

Commit a20f87a

Browse files
authored
ref: Remove iconSize from ReplayPlayPauseButton (#68744)
Buttons use `<IconDefaultsProvider>` internally to set the size of icons. We can leverage that and remove some extra props in this use-case
1 parent d1130d7 commit a20f87a

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

static/app/components/replays/replayPlayPauseButton.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,13 @@ import {useReplayContext} from 'sentry/components/replays/replayContext';
44
import {IconPause, IconPlay, IconRefresh} from 'sentry/icons';
55
import {t} from 'sentry/locale';
66

7-
function ReplayPlayPauseButton(
8-
props: BaseButtonProps & {
9-
iconSize?: React.ComponentProps<typeof IconPlay>['size'];
10-
}
11-
) {
7+
function ReplayPlayPauseButton(props: BaseButtonProps) {
128
const {isFinished, isPlaying, restart, togglePlayPause} = useReplayContext();
13-
const iconSize = props.iconSize ?? 'md';
149

1510
return isFinished ? (
1611
<Button
1712
title={t('Restart Replay')}
18-
icon={<IconRefresh size={iconSize} />}
13+
icon={<IconRefresh />}
1914
onClick={restart}
2015
aria-label={t('Restart Replay')}
2116
priority="primary"
@@ -24,7 +19,7 @@ function ReplayPlayPauseButton(
2419
) : (
2520
<Button
2621
title={isPlaying ? t('Pause') : t('Play')}
27-
icon={isPlaying ? <IconPause size={iconSize} /> : <IconPlay size={iconSize} />}
22+
icon={isPlaying ? <IconPause /> : <IconPlay />}
2823
onClick={() => togglePlayPause(!isPlaying)}
2924
aria-label={isPlaying ? t('Pause') : t('Play')}
3025
priority="primary"

static/app/views/replays/replayTable/tableCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ export function PlayPauseCell({
644644
isSelected: boolean;
645645
}) {
646646
const inner = isSelected ? (
647-
<ReplayPlayPauseButton size="sm" iconSize="sm" priority="default" borderless />
647+
<ReplayPlayPauseButton size="sm" priority="default" borderless />
648648
) : (
649649
<Button
650650
title={t('Play')}

0 commit comments

Comments
 (0)