UNPKG

@storybook/addon-ondevice-controls

Version:

Display storybook controls on your device.

13 lines (12 loc) 609 B
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime"; import { styled } from '@storybook/react-native-theming'; import TypeMap from './types'; const InvalidTypeText = styled.Text(({ theme }) => ({ color: theme.color.negative, })); const InvalidType = ({ arg }) => (_jsxs(InvalidTypeText, { children: ["Invalid type: ", arg.type] })); const PropField = ({ onChange, arg, isPristine }) => { const InputType = TypeMap[arg.type]; return InputType ? (_jsx(InputType, { arg: arg, isPristine: isPristine, onChange: onChange })) : (_jsx(InvalidType, { arg: arg })); }; export default PropField;