Add icons

This commit is contained in:
Jake Howard 2016-03-11 11:00:07 +00:00
parent a22145b4a8
commit 7e2920b694

View file

@ -2,6 +2,7 @@ import React from 'react-native';
import GlobalStyles from '../../settings/styles'; import GlobalStyles from '../../settings/styles';
import { getProjectRecentBuilds } from '../../api/CircleCI'; import { getProjectRecentBuilds } from '../../api/CircleCI';
import moment from 'moment'; import moment from 'moment';
import Icon from 'react-native-vector-icons/Octicons';
const { const {
View, View,
@ -74,9 +75,9 @@ export default class ProjectItem extends React.Component {
const commit = mostRecentBuild.all_commit_details[0]; const commit = mostRecentBuild.all_commit_details[0];
return ( return (
<View style={styles.buildCell}> <View style={styles.buildCell}>
<Text style={styles.details}>#{ mostRecentBuild.build_num }</Text> <Text style={styles.details}><Icon name="pulse" /> #{ mostRecentBuild.build_num }</Text>
<Text style={styles.details}>D: { buildTime }</Text> <Text style={styles.details}><Icon name="history" /> { buildTime }</Text>
<Text style={styles.details}>C: { commit.commit.substring(0, 6) }</Text> <Text style={styles.details}><Icon name="git-commit" /> { commit.commit.substring(0, 6) }</Text>
</View> </View>
); );
} }
@ -90,10 +91,10 @@ export default class ProjectItem extends React.Component {
GlobalStyles.get('CIRCLE_TEST_FAIL') : GlobalStyles.get('CIRCLE_TEST_FAIL') :
GlobalStyles.get('CIRCLE_TEST_PASS'); GlobalStyles.get('CIRCLE_TEST_PASS');
const username = this.props.userDetails && this.props.userDetails.login !== project.username ? const username = this.props.userDetails && this.props.userDetails.login !== project.username ?
(<Text style={styles.details}>U: {project.username}</Text>) : null; (<Text style={styles.details}><Icon name="person" /> {project.username}</Text>) : null;
const language = project.language ? const language = project.language ?
(<Text style={styles.details}>L: {project.language}</Text>) : null; (<Text style={styles.details}><Icon name="keyboard" /> {project.language}</Text>) : null;
const buildDetails = mostRecentBuild ? this._displayMoreInfo(mostRecentBuild) : null; const buildDetails = mostRecentBuild ? this._displayMoreInfo(mostRecentBuild) : null;