How to use the @storybook/react-native.action function in @storybook/react-native

To help you get started, we’ve selected a few @storybook/react-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Skyscanner / backpack / native / packages / react-native-bpk-component-card / stories.js View on Github external
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo
    ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis
    parturient montes, nascetur ridiculus mus.
  
);

const mainContent = (
  
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo
    ligula eget dolor. Aenean massa.
  
);

const stubContent = Lorem ipsum dolor sit amet.;

const onPress = action('Card press');

const styles = StyleSheet.create({
  cardListScrollView: {
    overflow: 'visible',
  },
  cardListItem: {
    marginTop: 20, // eslint-disable-line backpack/use-tokens
  },
  cardMainStyle: {
    flex: 3,
  },
});

storiesOf('react-native-bpk-component-card', module)
  .addDecorator(CenterDecorator)
  .add('docs:default', () => {content})
github monterosalondon / react-native-parallax-scroll / storybook / stories / index.js View on Github external
.add('List view', () => (
     }
      renderHeader={() =&gt; <header>}
      headerHeight={number('Header height', 50)}
      onHeaderFixed={action('onHeaderFixed')}
      isHeaderFixed={boolean('Is header fixed', true)}
      parallaxHeight={number('Parallax height', 250)}
      useNativeDriver={boolean('Use native driver', true)}
      scrollableComponent={ListView}
      isBackgroundScalable={boolean('Is background scalable', true)}
      headerBackgroundColor={text('Header bacground color', 'rgba(51, 51, 51, 1)')}
      onChangeHeaderVisibility={action('onChangeHeaderVisibility')}
      renderParallaxBackground={getBackground}
      fadeOutParallaxBackground={boolean('Fade out background', false)}
      renderParallaxForeground={getForeground}
      fadeOutParallaxForeground={boolean('Fade out foreground', true)}
      headerFixedBackgroundColor={text('Header fixed bacground color', 'rgba(51, 51, 51, 1)')}
      parallaxBackgroundScrollSpeed={number('Background scroll speed', 5)}
      parallaxForegroundScrollSpeed={number('Foreground scroll speed', 2.5)}
    /&gt;
  ))</header>
github Skyscanner / backpack / native / packages / react-native-bpk-component-touchable-native-feedback / stories.js View on Github external
},
  wrappingView: {
    borderRadius: borderRadiusSm,
  },
});

const textContent = (
  
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo
    ligula eget dolor. Aenean massa.
  
);

const viewContent = ;

const onPress = action('Touchable native feedback press');

storiesOf('react-native-bpk-component-touchable-native-feedback', module)
  .addDecorator(CenterDecorator)
  .add('docs:default', () =&gt; (
    
      {viewContent}
    
  ))
  .add('View Wrapper', () =&gt; (
github monterosalondon / react-native-parallax-scroll / storybook / stories / index.js View on Github external
.add('with header', () =&gt; (
     <header height="{height}">}
      headerHeight={number('Header height', 50)}
      onHeaderFixed={action('onHeaderFixed')}
      isHeaderFixed={boolean('Is header fixed', true)}
      parallaxHeight={number('Parallax height', 250)}
      useNativeDriver={boolean('Use native driver', false)}
      isBackgroundScalable={boolean('Is background scalable', true)}
      headerBackgroundColor={text('Header bacground color', 'rgba(51, 51, 51, 0)')}
      renderParallaxBackground={getBackground}
      onChangeHeaderVisibility={action('onChangeHeaderVisibility')}
      fadeOutParallaxBackground={boolean('Fade out background', true)}
      headerFixedBackgroundColor={text('Header fixed bacground color', 'rgba(51, 51, 51, 1)')}
      parallaxBackgroundScrollSpeed={number('Background scroll speed', 5)}
    &gt;
      
    
  ))
  .add('without header background', () =&gt; (</header>
github monterosalondon / react-native-parallax-scroll / storybook / stories / FixedChildrenExample / index.js View on Github external
          renderParallaxForeground={() =&gt; }
          fadeOutParallaxBackground={boolean('Fade out background', false)}
github monterosalondon / react-native-parallax-scroll / storybook / stories / FixedChildrenExample / index.js View on Github external
style={style}
          renderHeader={({ animatedValue }) =&gt;
            <header>
          }
          headerHeight={number('Header height', 90)}
          isHeaderFixed={boolean('Is header fixed', true)}
          onHeaderFixed={isHeaderFixed =&gt; this.setState({ isHeaderFixed })}
          parallaxHeight={number('Parallax height', 250)}
          useNativeDriver={boolean('Use native driver', true)}
          isBackgroundScalable={boolean('Is background scalable', true)}
          headerBackgroundColor={text('Header bacground color', 'rgba(51, 51, 51, 0)')}
          headerFixedTransformY={text('Header fixed transform y', 30)}
          renderParallaxBackground={() =&gt;
            
          }
          onChangeHeaderVisibility={action('onChangeHeaderVisibility')}
          renderParallaxForeground={() =&gt; }
          fadeOutParallaxBackground={boolean('Fade out background', false)}
          fadeOutParallaxForeground={boolean('Fade out foreground', true)}
          headerFixedBackgroundColor={text('Header fixed bacground color', 'rgba(51, 51, 51, 1)')}
          parallaxBackgroundScrollSpeed={number('Background scroll speed', 5)}
          parallaxForegroundScrollSpeed={number('Foreground scroll speed', 2.5)}
        &gt;
          </header>