Skip to content

More generic cards #21

@Enkumicahel

Description

@Enkumicahel

What if I want to render my own footer in the cards. Why is it mandatory to use the avatar given. And even if I keep the avatar prop null it still takes space. Don't you think it is better to make it more generic where if the card's avatar prop is null it takes no space in the card?

            {cards && cards.map((card, id) => (
              <Card
                key={`card-${card.image}`}
                flex
                borderless
                shadowColor={theme.COLORS.BLACK}
                titleColor={card.full ? theme.COLORS.WHITE : null}
                style={styles.card}
                image={card.image}
                imageStyle={[card.padded ? styles.rounded : null]}
                imageBlockStyle={[
                  card.padded ? { padding: theme.SIZES.BASE / 2 } : null,
                  card.full ? null : styles.noRadius,
                  styles.cardImage
                ]}
                footerStyle={card.full ? styles.full : null}
              >
                <Block flex row space="around" > 
                {card.full ? <LinearGradient colors={['transparent', 'rgba(0,0,0, 0.3)']} style={styles.gradient} /> : null}
                  <Block flex={0.3}>{renderAvatar(card.avatar)}</Block>
                  {renderVote(card.vote)}
                  {renderLike(card.like)}
                </Block>
              </Card>
            ))}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions