import React, { useState } from 'react'; import { StyleSheet } from 'react-native'; import { storiesOf } from '@storybook/react-native'; import { Tab, Tabs } from '@aws-amplify/ui-react-native/dist/primitives'; const ControlledTabs = ({ ...props }: any) => { const [selectedIndex, setSelectedIndex] = useState( props.selectedIndex ); const handleOnChange = (nextValue: number) => { setSelectedIndex(nextValue); }; return ( {props.children} ); }; storiesOf('Tabs', module) .add('default', () => ( Sign In Create Account )) .add('disabled', () => ( Tab 1 Tab 2 (disabled) )) .add('multiple', () => ( Tab 1 Tab 2 Tab 3 )) .add('indicatorPosition', () => ( Tab 1 Tab 2 Tab 3 )) .add('styles', () => ( Tab 1 Tab 2 )); const styles = StyleSheet.create({ container: { width: '90%' }, styledContainer: { borderColor: 'gray', borderWidth: StyleSheet.hairlineWidth, }, tabStyle1: { backgroundColor: 'green', borderTopColor: 'yellow', }, tabStyle2: { backgroundColor: 'lavender', borderTopColor: 'rebeccapurple', }, tabTextStyle1: { color: 'yellow', fontWeight: '900', }, tabTextStyle2: { color: 'gray', fontWeight: '500', }, });