Skip to content

Commit 39eca8a

Browse files
authored
fix: address misc todos (#22012)
1 parent 9d14fd2 commit 39eca8a

6 files changed

Lines changed: 3 additions & 21 deletions

File tree

packages/react/src/components/AISkeleton/AISkeletonPlaceholder.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,9 @@ const AISkeletonPlaceholder = ({
2323
...other
2424
}: AISkeletonPlaceholderProps) => {
2525
const prefix = usePrefix();
26-
// TODO: Fix the `classnames` call. It adds a literal `className` class when
27-
// `className` is truthy.
28-
/*
2926
const AISkeletonPlaceholderClasses = classNames(className, {
3027
[`${prefix}--skeleton__placeholder--ai`]: true,
3128
});
32-
*/
33-
const AISkeletonPlaceholderClasses = classNames(
34-
{ className, [`${prefix}--skeleton__placeholder--ai`]: true },
35-
className
36-
);
3729

3830
return (
3931
<SkeletonPlaceholder className={AISkeletonPlaceholderClasses} {...other} />

packages/react/src/components/AISkeleton/__tests__/AISkeleton-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ describe('AISkeleton', () => {
2222

2323
expect(screen.getByTestId('ai-skeleton-placeholder')).toHaveClass(
2424
'cds--skeleton__placeholder',
25-
'className',
2625
'cds--skeleton__placeholder--ai',
2726
'💾',
2827
{ exact: true }

packages/react/src/components/Slider/__tests__/Slider-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ describe('Slider', () => {
14621462
expect(onChange).not.toHaveBeenCalled();
14631463
});
14641464

1465-
it.skip('gracefully tolerates empty event passed to _onDrag', () => {
1465+
it('gracefully tolerates empty event passed to _onDrag', () => {
14661466
const { mouseDown, mouseUp, mouseMove } = fireEvent;
14671467
const { container } = renderTwoHandleSlider({
14681468
value: initialValueLower,

packages/react/src/components/Switch/IconSwitch.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,8 @@ IconSwitch.propTypes = {
217217
*/
218218
selected: PropTypes.bool,
219219

220-
// TODO: Icon only variant of what? Isn't the `IconSwitch` always icon only?
221220
/**
222-
* Passed in from `ContentSwitcher` to render icon-only variant
221+
* Specify the size of the underlying icon-only button.
223222
*/
224223
size: PropTypes.oneOf(['sm', 'md', 'lg']),
225224

packages/react/src/components/Tabs/Tabs.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import { Text } from '../Text';
5252
import BadgeIndicator from '../BadgeIndicator';
5353
import { isComponentElement } from '../../internal';
5454

55+
const buttonWidth = 44;
5556
const verticalTabHeight = 64;
5657

5758
// Used to manage the overall state of the Tabs
@@ -503,9 +504,6 @@ function TabList({
503504
// SCROLLABLE
504505
// AND SCROLL_LEFT > 0
505506
//
506-
// TODO: Hoist `buttonWidth` to a module level constant like
507-
// `verticalTabHeight`.
508-
const buttonWidth = 44;
509507
// Next Button
510508
// VISIBLE IF:
511509
// SCROLLABLE

packages/react/src/components/Tile/Tile.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,21 +251,15 @@ export const ClickableTile = React.forwardRef<
251251
className
252252
);
253253

254-
// TODO: Can this be removed? Or is cds--tile--is-clicked supposed to use this instead of `clicked`?
255-
// This state is never used
256-
const [isSelected, setIsSelected] = useState(clicked);
257-
258254
function handleOnClick(evt: MouseEvent<HTMLAnchorElement>) {
259255
evt?.persist?.();
260-
setIsSelected(!isSelected);
261256
onClick(evt);
262257
}
263258

264259
function handleOnKeyDown(evt: KeyboardEvent<HTMLAnchorElement>) {
265260
evt?.persist?.();
266261
if (!href && matches(evt, [keys.Enter, keys.Space])) {
267262
evt.preventDefault();
268-
setIsSelected(!isSelected);
269263
onClick(evt);
270264
}
271265
onKeyDown(evt);

0 commit comments

Comments
 (0)