Skip to content

Commit

Permalink
Migrate Checkbox story to tsx - see #18100 (#18101)
Browse files Browse the repository at this point in the history
Looks good!
  • Loading branch information
ad-m authored Jan 20, 2022
1 parent 5ce79ff commit c3a17a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import React from 'react';
import { useArgs } from '@storybook/client-api';
import Checkbox from '.';
import Checkbox, { CheckboxProps } from '.';

export default {
title: 'Checkbox',
Expand All @@ -42,9 +42,8 @@ export const CheckboxGallery = () =>
</div>
));

// eslint-disable-next-line no-unused-vars
export const InteractiveCheckbox = _args => {
const [{ checked, style }, updateArgs] = useArgs();
export const InteractiveCheckbox = ({ checked, style }: CheckboxProps) => {
const [, updateArgs] = useArgs();
const toggleCheckbox = () => {
updateArgs({ checked: !checked });
};
Expand Down
2 changes: 2 additions & 0 deletions superset-frontend/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ export default function Checkbox({ checked, onChange, style }: CheckboxProps) {
</Styles>
);
}

export type { CheckboxProps };
2 changes: 1 addition & 1 deletion superset-frontend/src/components/Checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
* specific language governing permissions and limitations
* under the License.
*/
export { default } from 'src/components/Checkbox/Checkbox';
export { default, CheckboxProps } from 'src/components/Checkbox/Checkbox';
export * from 'src/components/Checkbox/CheckboxIcons';

0 comments on commit c3a17a7

Please sign in to comment.