forked from expo/react-conf-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpeakerCard.tsx
69 lines (64 loc) · 1.77 KB
/
SpeakerCard.tsx
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
61
62
63
64
65
66
67
68
69
import { Link } from "expo-router";
import { StyleSheet, View } from "react-native";
import { SpeakerImage } from "./SpeakerImage";
import { ThemedText, ThemedView, useThemeColor } from "./Themed";
import { theme } from "../theme";
import { Speaker } from "../types";
import { TouchableOpacity } from "react-native-gesture-handler";
type Props = {
speaker: Speaker;
};
export function SpeakerCard({ speaker }: Props) {
const shadow = useThemeColor({ light: theme.dropShadow, dark: undefined });
return (
<Link
push
key={speaker.id}
href={{
pathname: "/speaker/[speaker]",
params: { speaker: speaker.id },
}}
asChild
>
<TouchableOpacity activeOpacity={0.8}>
<ThemedView
style={[styles.speakerCard, shadow]}
darkColor="rgba(255,255,255,0.15)"
lightColor={theme.colorThemeLightGrey}
>
<View style={styles.speakerHeadline}>
<SpeakerImage
animated
profilePicture={speaker.profilePicture}
size="large"
/>
<View style={styles.speakerDetail}>
<ThemedText fontSize={20} fontWeight="bold">
{speaker.fullName}
</ThemedText>
<ThemedText fontSize={16} marginBottom={theme.space8}>
{speaker.tagLine}
</ThemedText>
</View>
</View>
</ThemedView>
</TouchableOpacity>
</Link>
);
}
const styles = StyleSheet.create({
speakerCard: {
flex: 1,
padding: theme.space16,
marginHorizontal: theme.space16,
borderRadius: theme.borderRadius10,
},
speakerDetail: {
flex: 1,
justifyContent: "center",
},
speakerHeadline: {
flex: 1,
flexDirection: "row",
},
});