Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More generic cards #21

Open
Enkumicahel opened this issue Jun 12, 2020 · 0 comments
Open

More generic cards #21

Enkumicahel opened this issue Jun 12, 2020 · 0 comments

Comments

@Enkumicahel
Copy link

Enkumicahel commented Jun 12, 2020

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>
            ))}
@Enkumicahel Enkumicahel changed the title What if I want 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? More generic cards Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant