Created
January 4, 2023 19:59
-
-
Save xiongemi/813e4233801d344d3f1c2ee7dbe16682 to your computer and use it in GitHub Desktop.
carousel code component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Card, Title, Paragraph } from 'react-native-paper'; | |
export interface CarouselProps { | |
imageUri?: string; | |
title?: string; | |
content: string; | |
} | |
export function Carousel({ imageUri, title, content }: CarouselProps) { | |
return ( | |
<Card> | |
{imageUri && <Card.Cover source={{ uri: imageUri }} />} | |
<Card.Content> | |
{title && <Title>{title}</Title>} | |
<Paragraph>{content}</Paragraph> | |
</Card.Content> | |
</Card> | |
); | |
} | |
export default Carousel; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment