Skip to content

Commit

Permalink
refactor(tab-set): update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Yorsh committed Oct 23, 2018
1 parent 90000c2 commit 141254e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { bootstrap } from './style/themeBootstrapper';
bootstrap();

const ExplorerApp = StackNavigator({
Home: { screen: Screens.TabSetScreen },
Home: { screen: Screens.TabViewScreen },
Picker: { screen: Screens.PickerScreen },
Button: { screen: Screens.ButtonScreen },
Calendars: { screen: Screens.CalendarScreen },
Expand All @@ -26,8 +26,8 @@ const ExplorerApp = StackNavigator({
HorizontalCalendar: { screen: Screens.HorizontalCalendarScreen },
Switch: { screen: Screens.SwitchScreen },
Choice: { screen: Screens.ChoiceScreen },
Tab: { screen: Screens.TabScreen },
TabSet: { screen: Screens.TabSetScreen },
// Tab: { screen: Screens.TabScreen },
TabSet: { screen: Screens.TabViewScreen },
Card: { screen: Screens.CardScreen },
Avatar: { screen: Screens.AvatarScreen },
Input: { screen: Screens.InputScreen },
Expand Down
4 changes: 2 additions & 2 deletions example/screens/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export * from './ComponentsScreen';
export * from './ImageScreen';
export * from './GalleryScreen';
export * from './InputScreen';
export * from './TabScreen';
export * from './tabset/TabSetScreen';
// export * from './TabScreen';
export * from './tabset/TabViewScreen';
export * from './SettingsScreen';
export * from './ChoiceCustomizationScreen';
export * from './PickerScreen';
Expand Down
12 changes: 5 additions & 7 deletions example/screens/tabset/TabContentScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ export class TabContentScreen extends React.Component {
message: 'I <3 React Native UI Kitten',
};

render() {
return (
<View style={[styles.container, this.props.style]}>
<Text style={styles.text}>{this.props.message}</Text>
</View>
);
}
render = () => (
<View style={[styles.container, this.props.style]}>
<Text style={styles.text}>{this.props.message}</Text>
</View>
);
}

const styles = RkStyleSheet.create(theme => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
import React from 'react';
import { View } from 'react-native';
import {
RkTabSet,
RkTabSetItem,
RkTabView,
RkTab,
RkStyleSheet,
} from 'react-native-ui-kitten';
import { TabContentScreen } from './TabContentScreen';

export class TabSetScreen extends React.Component {
export class TabViewScreen extends React.Component {
static navigationOptions = {
title: 'Tab Set',
};
static propTypes = {};

render() {
return (
<View style={styles.container}>
<RkTabSet>
<RkTabSetItem title="Tab #1">
<RkTabView style={styles.container} onItemChange={this.onItemChange}>
<RkTab title="Tab #1">
<TabContentScreen style={styles.tabContent1} />
</RkTabSetItem>
<RkTabSetItem title="Tab #2" isSelected={true}>
<TabContentScreen style={styles.tabContent2} message='Tab 2 loves React Native UI Kitten' />
</RkTabSetItem>
<RkTabSetItem title="Tab #3">
</RkTab>
<RkTab title="Tab #2" isSelected={true}>
<TabContentScreen
style={styles.tabContent2}
message='Tab 2 loves React Native UI Kitten'
/>
</RkTab>
<RkTab title="Tab #3">
<TabContentScreen style={styles.tabContent3} />
</RkTabSetItem>
</RkTabSet>
</RkTab>
</RkTabView>
</View>
);
}
Expand Down

0 comments on commit 141254e

Please sign in to comment.