Skip to content

Commit

Permalink
Migrate Checkbox story to tsx - see apache#18100
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-m committed Jan 20, 2022
1 parent 035638c commit 8975cc4
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 8975cc4

Please sign in to comment.