Newer
Older
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
70
71
72
73
74
75
76
77
78
79
import React from 'react';
import {View, Text, StyleSheet} from 'react-native';
import {ColorPallet, TextTheme} from 'src/theme/theme';
type PrivatePersonProps = {
jsonld: any;
};
const VereignPrivatePerson: React.FC<PrivatePersonProps> = ({
jsonld,
}) => {
const subject = jsonld.credentialSubject || {};
const name = subject["vereign:name"];
const dateOfBirth = subject["vereign:dateOfBirth"];
const address = subject["vereign:address"] || {};
const street = address["vereign:street"];
const building = address["vereign:building"];
const city = address["vereign:city"];
const country = address["vereign:country"];
return (
<View>
<Text style={styles.header}>JSON-LD</Text>
<View style={styles.prop}>
<Text style={styles.propLabel}>Name</Text>
<Text style={styles.propValue}>{name}</Text>
</View>
<View style={styles.prop}>
<Text style={styles.propLabel}>DateOfBirth</Text>
<Text style={styles.propValue}>{dateOfBirth}</Text>
</View>
<View style={styles.prop}>
<Text style={styles.propLabel}>Street</Text>
<Text style={styles.propValue}>{street}</Text>
</View>
<View style={styles.prop}>
<Text style={styles.propLabel}>Building</Text>
<Text style={styles.propValue}>{building}</Text>
</View>
<View style={styles.prop}>
<Text style={styles.propLabel}>City</Text>
<Text style={styles.propValue}>{city}</Text>
</View>
<View style={styles.prop}>
<Text style={styles.propLabel}>Country</Text>
<Text style={styles.propValue}>{country}</Text>
</View>
</View>
);
};
export default VereignPrivatePerson;
const styles = StyleSheet.create({
header: {
...TextTheme.normal,
color: ColorPallet.baseColors.black,
fontWeight: 'bold',
marginBottom: 8,
},
prop: {
flexDirection: 'row',
paddingVertical: 4,
},
propLabel: {
width: '40%',
...TextTheme.normal,
color: ColorPallet.baseColors.black,
fontWeight: 'bold',
},
propValue: {
width: '60%',
...TextTheme.normal,
color: ColorPallet.baseColors.black,
textAlign: 'right',
},
});