app/components/card_view/index.js
//displays card type on top, followed by image and the rest of the card information
displays card type on top, followed by image and the rest of the card information
displays card type on top followed by image and the rest of the card information
render() {
        var cardFields = [];
        for (var key in this.props.card.fields)
        {
            cardFields.push (key + ": " + this.props.card.fields[key] + "\n\n");
        }
        var icon = this.props.card.image === "" ? require('../../assets/default_avatar.png') : {uri: this.props.card.image};
        var args = this.props.card.owner === true ?
            {sender: this.props.card, recipient: null} :
            {sender: null, recipient: this.props.card};
        if(!this.props.isWallet){        
            return (
                <View style={styles.container}>
                    <Text style={styles.header}>
                        {this.props.card.label}
                    </Text>
                    <View style={styles.cardPosition}>
                        <Avatar
                            xlarge
                            rounded
                            source = {icon}
                        />
                    </View>
                    <View style={styles.row}>
                        <Text style={styles.name}>
                            Name: {this.props.card.name}
                        </Text>
                        <Text style={styles.name}>
                            Email: {this.props.card.email}
                        </Text>
                        <Text style={styles.name}>
                            {cardFields}
                        </Text>
                    </View>
                    <View style={styles.buttonContainer}>
                        <Button 
                            title="Share"
                            onPress={() => Actions.share({card: this.props.card})}
                            buttonStyle={styles.button}
                        />
                        <Button 
                            title="Message"
                            onPress={() => Actions.create_message(args)}
                            buttonStyle={styles.button}
                        />
                    </View>
                </View>
            );
        }
        else{
            return (
                <View style={styles.container}>
                    <Text style={styles.header}>
                        {this.props.card.label}
                    </Text>
                    <View style={styles.cardPosition}>
                        <Avatar
                            xlarge
                            rounded
                            source = {icon}
                        />
                    </View>
                    <View style={styles.row}>
                        <Text style={styles.name}>
                            Name: {this.props.card.name}
                        </Text>
                        <Text style={styles.name}>
                            Email: {this.props.card.email}
                        </Text>
                        <Text style={styles.name}>
                            {cardFields}
                        </Text>
                    </View>
                    <View style={styles.buttonContainer}>
                        <Button 
                            title="Share"
                            onPress={() => Actions.share({card: this.props.card})}
                            buttonStyle={styles.walletButton}
                        />
                        <Button 
                            title="Message"
                            onPress={() => Actions.create_message(args)}
                            buttonStyle={styles.walletButton}
                        />
                        <Button 
                            title="Default"
                            onPress={() => this.handleSetDefault()}
                            buttonStyle={styles.walletButton}
                        />
                    </View>
                </View>
            );
        }
    }
render ( ) { var cardFields = [ ] ; for ( var key in this . props . card . fields ) { cardFields . push ( key + ": " + this . props . card . fields [ key ] + "\n\n" ) ; } var icon = this . props . card . image === "" ? require ( '../../assets/default_avatar.png' ) : { uri : this . props . card . image } ; var args = this . props . card . owner === true ? { sender : this . props . card , recipient : null } : { sender : null , recipient : this . props . card } ; if ( ! this . props . isWallet ) { return ( < View style = { styles . container } > < Text style = { styles . header } > { this . props . card . label } < / Text > < View style = { styles . cardPosition } > < Avatar xlarge rounded source = { icon } / > < / View > < View style = { styles . row } > < Text style = { styles . name } > 
                            Name:  { this . props . card . name } < / Text > < Text style = { styles . name } > 
                            Email:  { this . props . card . email } < / Text > < Text style = { styles . name } > { cardFields } < / Text > < / View > < View style = { styles . buttonContainer } > < Button title = "Share" onPress = { ( ) => Actions . share ( { card : this . props . card } ) } buttonStyle = { styles . button } / > < Button title = "Message" onPress = { ( ) => Actions . create_message ( args ) } buttonStyle = { styles . button } / > < / View > < / View > ) ; } else { return ( < View style = { styles . container } > < Text style = { styles . header } > { this . props . card . label } < / Text > < View style = { styles . cardPosition } > < Avatar xlarge rounded source = { icon } / > < / View > < View style = { styles . row } > < Text style = { styles . name } > 
                            Name:  { this . props . card . name } < / Text > < Text style = { styles . name } > 
                            Email:  { this . props . card . email } < / Text > < Text style = { styles . name } > { cardFields } < / Text > < / View > < View style = { styles . buttonContainer } > < Button title = "Share" onPress = { ( ) => Actions . share ( { card : this . props . card } ) } buttonStyle = { styles . walletButton } / > < Button title = "Message" onPress = { ( ) => Actions . create_message ( args ) } buttonStyle = { styles . walletButton } / > < Button title = "Default" onPress = { ( ) => this . handleSetDefault ( ) } buttonStyle = { styles . walletButton } / > < / View > < / View > ) ; } }
displays card type on top, followed by image and the rest of the card information
displays card type on top followed by image and the rest of the card information
//displays card with no option to set default card //displays card with option to set the default card