Skip to content

Commit

Permalink
refactor(react): update ContentSwitcher and Switch to hooks (#3302)
Browse files Browse the repository at this point in the history
* chore: check-in work

* chore: check-in work

* chore: check-in work

* refactor(react): update ContentSwitcher and Switch to hooks

* fix(react): update deprecate to correctly warn

* chore: check-in work

* fix(react): update ContentSwitcher focus

* chore(react): update test for activeElement
  • Loading branch information
joshblack authored Jul 16, 2019
1 parent c8911ec commit 954ac48
Show file tree
Hide file tree
Showing 12 changed files with 632 additions and 487 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { withKnobs, boolean } from '@storybook/addon-knobs';
import { withKnobs, boolean, number } from '@storybook/addon-knobs';
import ContentSwitcher from '../ContentSwitcher';
import Switch from '../Switch';

Expand All @@ -29,10 +29,12 @@ storiesOf('ContentSwitcher', module)
() => {
const switchProps = props.switch();
return (
<ContentSwitcher {...props.contentSwitcher()}>
<Switch name="one" text="First section" {...switchProps} />
<Switch name="two" text="Second section" {...switchProps} />
<Switch name="three" text="Third section" {...switchProps} />
<ContentSwitcher
{...props.contentSwitcher()}
selectedIndex={number('Selected Index (selectedIndex)', 0)}>
<Switch text="First section" {...switchProps} />
<Switch text="Second section" {...switchProps} />
<Switch text="Third section" {...switchProps} />
</ContentSwitcher>
);
},
Expand All @@ -51,9 +53,9 @@ storiesOf('ContentSwitcher', module)
const switchProps = props.switch();
return (
<ContentSwitcher {...props.contentSwitcher()} selectedIndex={1}>
<Switch name="one" text="First section" {...switchProps} />
<Switch name="two" text="Second section" {...switchProps} />
<Switch name="three" text="Third section" {...switchProps} />
<Switch text="First section" {...switchProps} />
<Switch text="Second section" {...switchProps} />
<Switch text="Third section" {...switchProps} />
</ContentSwitcher>
);
},
Expand Down
167 changes: 0 additions & 167 deletions packages/react/src/components/ContentSwitcher/ContentSwitcher-test.js

This file was deleted.

Loading

0 comments on commit 954ac48

Please sign in to comment.