From 73308af061af5e17ac7d4a73fa027a2f303c70dd Mon Sep 17 00:00:00 2001 From: Kirill Rogovoy Date: Fri, 23 Jul 2021 11:02:26 +0300 Subject: Update graph data when Emacs node changes + minor improvements --- .../components/text-field/text-field.story.tsx | 159 --------------------- 1 file changed, 159 deletions(-) delete mode 100644 app_expo/components/text-field/text-field.story.tsx (limited to 'app_expo/components/text-field/text-field.story.tsx') diff --git a/app_expo/components/text-field/text-field.story.tsx b/app_expo/components/text-field/text-field.story.tsx deleted file mode 100644 index 5f4d408..0000000 --- a/app_expo/components/text-field/text-field.story.tsx +++ /dev/null @@ -1,159 +0,0 @@ -/* eslint-disable react-native/no-inline-styles */ -/* eslint-disable react-native/no-color-literals */ - -import * as React from 'react' -import { storiesOf } from '@storybook/react-native' -import { StoryScreen, Story, UseCase } from '../../../storybook/views' -import { Text, TextField } from '../' -import { State } from 'react-powerplug' -import { ViewStyle, TextStyle, Alert } from 'react-native' - -declare let module - -const styleArray: ViewStyle[] = [{ paddingHorizontal: 30 }, { borderWidth: 30 }] - -const inputStyleArray: TextStyle[] = [ - { - backgroundColor: 'rebeccapurple', - color: 'white', - padding: 40, - }, - { - borderWidth: 10, - borderRadius: 4, - borderColor: '#7fff00', - }, -] -let alertWhenFocused = true - -storiesOf('TextField', module) - .addDecorator((fn) => {fn()}) - .add('Labelling', () => ( - - - - {({ state, setState }) => ( - setState({ value })} - value={state.value} - label="Name" - placeholder="omg your name" - /> - )} - - - - - - {({ state, setState }) => ( - setState({ value })} - value={state.value} - placeholderTx="storybook.placeholder" - labelTx="storybook.field" - /> - )} - - - - )) - .add('Style Overrides', () => ( - - - - {({ state, setState }) => ( - setState({ value })} - value={state.value} - label="First Name" - style={{ paddingTop: 0, paddingHorizontal: 40 }} - /> - )} - - - {({ state, setState }) => ( - setState({ value })} - value={state.value} - label="Last Name" - style={{ paddingBottom: 0 }} - /> - )} - - - - - {({ state, setState }) => ( - setState({ value })} - value={state.value} - label="Name" - inputStyle={{ - backgroundColor: 'rebeccapurple', - color: 'white', - padding: 40, - borderWidth: 10, - borderRadius: 4, - borderColor: 'hotpink', - }} - /> - )} - - - - - - - {({ state, setState }) => ( - setState({ value })} - value={state.value} - label="Name" - style={styleArray} - inputStyle={inputStyleArray} - /> - )} - - - - - )) - .add('Ref Forwarding', () => ( - - - - {({ state, setState }) => ( - setState({ value })} - value={state.value} - label="Name" - inputStyle={{ - backgroundColor: 'rebeccapurple', - color: 'white', - padding: 40, - borderWidth: 10, - borderRadius: 4, - borderColor: 'hotpink', - }} - forwardedRef={(ref) => ref} - onFocus={() => { - if (alertWhenFocused) { - // Prevent text field focus from being repeatedly triggering alert - alertWhenFocused = false - Alert.alert('Text field focuesed with forwarded ref!') - } - }} - /> - )} - - - - - )) -- cgit v1.2.3