-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventCard.tsx
More file actions
60 lines (55 loc) · 1.29 KB
/
EventCard.tsx
File metadata and controls
60 lines (55 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import React, { FC } from "react";
import { Image, StyleSheet, View } from "react-native";
import EventCardText from "./EventCardText";
import EventCardRegistration from "./EventCardRegistration";
import { EventCardProps } from "@app/types/EventCard";
const cardColor = "white";
// Stylesheet for the EventCard component
const styles = StyleSheet.create({
banner: {
borderTopLeftRadius: 15,
borderTopRightRadius: 15,
height: 144,
margin: 0,
width: "100%",
},
card: {
backgroundColor: cardColor,
borderRadius: 15,
margin: 5,
padding: 0,
},
container: {
marginBottom: 0,
padding: 10,
},
});
const EventCard: FC<EventCardProps> = ({
style,
banner,
title,
timeBegin,
timeEnd,
location,
description,
}) => {
const onRegisterClicked = () => {
alert("Register button works!");
};
return (
<View style={[styles.card, style]}>
{banner ? <Image source={banner} style={styles.banner} /> : null}
<View style={styles.container}>
<EventCardText
title={title}
timeBegin={timeBegin}
timeEnd={timeEnd}
location={location}
description={description}
/>
<EventCardRegistration register={onRegisterClicked} />
</View>
</View>
);
};
export default EventCard;