Skip to content

Commit 7d8c5fd

Browse files
committed
Checkbox consolidate se23 logic
1 parent 700a72f commit 7d8c5fd

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

polaris-react/src/components/Checkbox/Checkbox.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React, {
55
useContext,
66
useId,
77
} from 'react';
8-
import {MinusMinor, TickSmallMinor} from '@shopify/polaris-icons';
8+
import {MinusMinor} from '@shopify/polaris-icons';
99

1010
import {classNames} from '../../utilities/css';
1111
import type {ResponsiveProp} from '../../utilities/css';
@@ -15,7 +15,6 @@ import {errorTextID} from '../InlineError';
1515
import {Icon} from '../Icon';
1616
import type {Error, CheckboxHandles} from '../../types';
1717
import {WithinListboxContext} from '../../utilities/listbox/context';
18-
import {useFeatures} from '../../utilities/features';
1918

2019
import styles from './Checkbox.scss';
2120

@@ -85,7 +84,6 @@ export const Checkbox = forwardRef<CheckboxHandles, CheckboxProps>(
8584
const uniqId = useId();
8685
const id = idProp ?? uniqId;
8786
const isWithinListbox = useContext(WithinListboxContext);
88-
const {polarisSummerEditions2023} = useFeatures();
8987

9088
useImperativeHandle(ref, () => ({
9189
focus: () => {
@@ -131,11 +129,7 @@ export const Checkbox = forwardRef<CheckboxHandles, CheckboxProps>(
131129
? {indeterminate: 'true', 'aria-checked': 'mixed' as const}
132130
: {'aria-checked': isChecked};
133131

134-
const iconSource = isIndeterminate ? MinusMinor : TickSmallMinor;
135-
136-
const animatedTickIcon = polarisSummerEditions2023 && !isIndeterminate;
137-
138-
const iconSourceSe23 = (
132+
const iconSource = (
139133
<svg
140134
viewBox="0 0 16 16"
141135
shapeRendering="geometricPrecision"
@@ -209,10 +203,10 @@ export const Checkbox = forwardRef<CheckboxHandles, CheckboxProps>(
209203
<span
210204
className={classNames(
211205
styles.Icon,
212-
animatedTickIcon && styles.animated,
206+
!isIndeterminate && styles.animated,
213207
)}
214208
>
215-
{animatedTickIcon ? iconSourceSe23 : <Icon source={iconSource} />}
209+
{isIndeterminate ? <Icon source={MinusMinor} /> : iconSource}
216210
</span>
217211
</span>
218212
</Choice>

0 commit comments

Comments
 (0)