forked from NativeScript/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDetailsScreen.tsx
More file actions
46 lines (43 loc) · 1.74 KB
/
DetailsScreen.tsx
File metadata and controls
46 lines (43 loc) · 1.74 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
import * as React from "react";
import { RouteProp } from '@react-navigation/core';
import { FrameNavigationProp } from "react-nativescript-navigation";
import { MainStackParamList } from "./NavigationParamList";
import { FlickService } from "../services";
type DetailsScreenProps = {
route: RouteProp<MainStackParamList, "Details">,
navigation: FrameNavigationProp<MainStackParamList, "Details">,
}
export function DetailsScreen({ route }: DetailsScreenProps) {
const flickId = route.params.flickId;
const flick = FlickService.getFlickById(flickId);
return (
<scrollView height="100%">
<stackLayout>
<image
margin="0"
stretch="aspectFill"
src={flick?.image}/>
<stackLayout padding="10 20">
{
flick.details.map((flickDetails, index) => (
<stackLayout key={index}>
<label
marginTop="15"
fontSize="16"
fontWeight="700"
class="text-primary"
textWrap="true"
text={flickDetails.title}/>
<label
fontSize="14"
class="text-secondary"
textWrap="true"
text={flickDetails.body}/>
</stackLayout>
))
}
</stackLayout>
</stackLayout>
</scrollView>
);
}