diff --git a/package.json b/package.json index 715cdbbdf..7ace27641 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "lodash": "4.16.4", "react": "15.3.2", "react-native": "0.34.1", + "react-native-button": "1.7.1", "react-native-keyboard-spacer": "0.3.0", "react-native-router-flux": "3.36.0", "react-redux": "4.4.5", diff --git a/src/components/channels_list_view.js b/src/components/channels_list_view.js index 34f3b06ff..acd7c01f6 100644 --- a/src/components/channels_list_view.js +++ b/src/components/channels_list_view.js @@ -2,59 +2,57 @@ // See License.txt for license information. import React, {Component, PropTypes} from 'react'; -import {ListView, StyleSheet, View, Text} from 'react-native'; -const {DataSource} = ListView; +import {View, Text} from 'react-native'; import {Actions as Routes} from 'react-native-router-flux'; +import Button from 'react-native-button'; import _ from 'lodash'; -import ErrorText from 'components/error_text'; -const styles = StyleSheet.create({ - container: { - flex: 1, - flexDirection: 'column', - alignItems: 'center', - paddingTop: 200, - backgroundColor: 'white' - } -}); +import ErrorText from 'components/error_text'; +import {GlobalStyles} from 'styles'; const propTypes = { + teams: PropTypes.object.isRequired, channels: PropTypes.object.isRequired, actions: PropTypes.object.isRequired }; class ChannelsListView extends Component { static propTypes = propTypes; - ds: DataSource = new DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); componentWillMount() { this.props.actions.fetchChannels(); } componentWillReceiveProps(props) { - if (props.channels.currentChannelId && - !this.props.channels.currentChannelId) { + const {currentChannelId} = props.channels; + if (currentChannelId && + currentChannelId !== this.props.channels.currentChannelId) { Routes.goToPostsList(); } } - setChannel(channel) { - this.props.actions.selectChannel(channel); - } - render() { + const {data: teams, currentTeamId} = this.props.teams; + const currentTeam = teams[currentTeamId]; const channels = _.values(this.props.channels.data); return ( - - ( - this.props.actions.selectChannel(channel)}> - {channel.display_name} - - )} - /> + + + {currentTeam.display_name} + + + {'Your channels:'} + + {_.map(channels, (channel) => ( + + ))} diff --git a/src/components/login_view.js b/src/components/login_view.js index dba8b56e2..826e64365 100644 --- a/src/components/login_view.js +++ b/src/components/login_view.js @@ -2,7 +2,7 @@ // See License.txt for license information. import React, {Component, PropTypes} from 'react'; -import {Image, StyleSheet, Text, TextInput, View} from 'react-native'; +import {View, Text, TextInput, Image} from 'react-native'; import {Actions as Routes} from 'react-native-router-flux'; import Button from 'components/button'; @@ -10,19 +10,6 @@ import ErrorText from 'components/error_text'; import {GlobalStyles} from 'styles'; import logo from 'images/logo.png'; -const styles = StyleSheet.create({ - container: { - flex: 1, - flexDirection: 'column', - alignItems: 'center', - paddingTop: 200, - backgroundColor: 'white' - }, - logo: { - marginBottom: 10 - } -}); - const propTypes = { login: PropTypes.object.isRequired, actions: PropTypes.object.isRequired @@ -51,13 +38,13 @@ export default class LoginView extends Component { render() { return ( - + - {'Mattermost'} - + {'Mattermost'} + {'All team communication in one place, searchable and accessible anywhere'} + ))} ); diff --git a/src/containers/channels_list_container.js b/src/containers/channels_list_container.js index 6ec7140cf..be9b288cc 100644 --- a/src/containers/channels_list_container.js +++ b/src/containers/channels_list_container.js @@ -8,6 +8,7 @@ import ChannelsListView from 'components/channels_list_view'; function mapStateToProps(state) { return { + teams: state.entities.teams, channels: state.entities.channels }; } diff --git a/src/styles/index.js b/src/styles/index.js index bc9ef09a4..08c601206 100644 --- a/src/styles/index.js +++ b/src/styles/index.js @@ -7,6 +7,42 @@ import {StyleSheet} from 'react-native'; export const GlobalStyles = StyleSheet.create({ + container: { + flex: 1, + flexDirection: 'column', + alignItems: 'center', + paddingTop: 200, + backgroundColor: 'white' + }, + logo: { + marginBottom: 10 + }, + header: { + fontSize: 36, + fontWeight: '600' + }, + subheader: { + fontSize: 18, + fontWeight: '300', + color: '#777' + }, + buttonListItemText: { + textAlign: 'left', + fontSize: 18, + fontWeight: '400', + color: '#777' + }, + buttonListItem: { + alignSelf: 'stretch', + height: 50, + marginHorizontal: 15, + marginVertical: 5, + padding: 13, + backgroundColor: '#fafafa', + borderWidth: 1, + borderRadius: 3, + borderColor: '#d5d5d5' + }, button: { margin: 3, paddingTop: 10, @@ -47,4 +83,4 @@ export const GlobalStyles = StyleSheet.create({ alignSelf: 'stretch', borderRadius: 3 } -}); \ No newline at end of file +});