galio-org / galio-starter-kit

Galio's starter kit is an app you can use to see what you can create with our library
https://galio.io
MIT License
182 stars 72 forks source link

More generic cards #21

Open Enkumicahel opened 4 years ago

Enkumicahel commented 4 years ago

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>
            ))}