Created
May 11, 2019 13:17
-
-
Save aplinxy9plin/56dec2570f8339135a756c97b2d97aa3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { View, Panel, PanelHeader, Tabbar, TabbarItem } from '@vkontakte/vkui'; | |
| import Icon28Messages from '@vkontakte/icons/dist/28/messages' | |
| import Icon28Search from '@vkontakte/icons/dist/28/search' | |
| export default class App extends React.Component { | |
| constructor (props) { | |
| super(props); | |
| | |
| this.state = { | |
| activeStory: 'feed' | |
| }; | |
| this.onStoryChange = this.onStoryChange.bind(this); | |
| } | |
| | |
| onStoryChange (e) { | |
| this.setState({ activeStory: e.currentTarget.dataset.story }) | |
| } | |
| | |
| render () { | |
| return ( | |
| <Epic activeStory={this.state.activeStory} tabbar={ | |
| <Tabbar> | |
| <TabbarItem | |
| onClick={this.onStoryChange} | |
| selected={this.state.activeStory === 'feed'} | |
| data-story="feed" | |
| text="Новости" | |
| ><Icon28Messages /></TabbarItem> | |
| <TabbarItem | |
| onClick={this.onStoryChange} | |
| selected={this.state.activeStory === 'discover'} | |
| data-story="discover" | |
| text="Поиск" | |
| ><Icon28Search /></TabbarItem> | |
| </Tabbar> | |
| }> | |
| <View id="feed" activePanel="feed"> | |
| <Panel id="feed"> | |
| <PanelHeader>Feed</PanelHeader> | |
| </Panel> | |
| </View> | |
| <View id="discover" activePanel="discover"> | |
| <Panel id="discover"> | |
| <PanelHeader>Discover</PanelHeader> | |
| </Panel> | |
| </View> | |
| </Epic> | |
| ) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment