@storybook/addon-ondevice-controls
Version:
Display storybook controls on your device.
11 lines (10 loc) • 543 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { Switch } from 'react-native';
import { styled } from '@storybook/react-native-theming';
const Container = styled.View(() => ({
alignItems: 'flex-start',
}));
const BooleanType = ({ arg, onChange }) => (_jsx(Container, { children: _jsx(Switch, { testID: arg.name, onValueChange: () => onChange(!arg.value), value: arg.value }) }));
BooleanType.serialize = (value) => (value ? String(value) : null);
BooleanType.deserialize = (value) => value === 'true';
export default BooleanType;