Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

styling: profile page and QR in card #118

Merged
merged 2 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 41 additions & 12 deletions wallet/wallet-app/components/frames/ProfileMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Button, Text } from 'react-native-ui-lib';
import { func } from 'prop-types';
import { signIn } from '../../redux/SignedInSlice';
import { getWalletID } from '../../utils/sign';

/**
* A profile site for administrativ changes on the profile
* @returns A new site, A logout button and a delete button
Expand Down Expand Up @@ -57,7 +58,7 @@ export default function ProfileMenuSlide() {
Alert.alert('VARSEL', 'Er du sikker på at du vil slette brukeren?', [
{
text: 'Cancel',
onPress: () => navigation.navigate('Oversikt'),
onPress: () => navigation.navigate('Profil'),
style: 'cancel',
},
{ text: 'OK', onPress: () => deleteUserPressed() },
Expand All @@ -79,24 +80,50 @@ export default function ProfileMenuSlide() {
<SafeAreaView style={{ display: 'flex', flexDirection: 'column', flexWrap: 'nowrap', alignContent: 'center' }}>
<View style={{ alignItems: 'flex-end', marginRight: 20, marginTop: 20 }}>
<Button
label="Slett bruker"
backgroundColor="rgb(194,19,44)"
label="Logg ut"
backgroundColor="rgb(0,98,184)"
size={Button.sizes.small}
onPress={buttonAlert}
onPress={() => dispatch(signIn(false))}
text90
/>
</View>
<View style={styles.container} marginTop={100}>
<Icon name="user-circle" size={220} color="rgb(30,46,60)" />
</View>
<View>
<View style={styles.container} marginTop={40}>
<Icon name="user" size={200} color="rgb(30,46,60)" />
</View>
<Text style={styles.textstyle}>Kari Nordman</Text>
</View>
<Text style={styles.issuerText}>Du har grunnidentitet utstedt fra: {baseIdIssuer}</Text>

<Text text90 style={{ marginLeft: 10, alignSelf: 'center', marginTop: 140 }}>
ID: {baseIdIssuer.substring(baseIdIssuer.length - 36)}
</Text>
<View
style={{
display: 'flex',
flexDirection: 'row',
flexWrap: 'nowrap',
marginTop: 1,
alignSelf: 'center',
}}>
<Icon name="check" size={10} color="rgb(30,46,60)" />

<Text text100 style={{ marginLeft: 4, marginTop: -3 }}>
Utstedt av: {baseIdIssuer.substring(0, baseIdIssuer.length - 36)}
</Text>
</View>
{/**
* Du har grunnidentitet utstedt fra: {baseIdIssuer}
*/}
<View width={320} style={{ alignSelf: 'center' }}>
<Button backgroundColor="rgb(0,98,184)" onPress={() => dispatch(signIn(false))}>
<Text style={styles.buttonTextlogOut}>Logg ut</Text>
</Button>
<Button
label="Slett bruker"
color="rgb(194,19,44)"
backgroundColor="transparent"
style={{ marginTop: 20 }}
size={Button.sizes.small}
onPress={buttonAlert}
text90
/>
</View>
</SafeAreaView>
);
Expand All @@ -106,10 +133,12 @@ const styles = StyleSheet.create({
container: {
paddingTop: 30,
alignSelf: 'center',
paddingHorizontal: 20,
},
textstyle: {
fontSize: 20,
fontSize: 30,
paddingHorizontal: 20,
marginTop: 20,
alignSelf: 'center',
color: 'rgb(30,46,60)',
},
Expand Down
49 changes: 26 additions & 23 deletions wallet/wallet-app/components/frames/VerifierLogFrame.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,22 @@ export default function VerifierLogFrame({ route }) {
]}
style={{ padding: 30, paddingTop: 0, paddingBottom: 0 }}
/>

<Card.Section
content={[{ text: 'Del med QR-kode: ', text70: true, grey40: true }]}
style={{ padding: 30, paddingTop: 50, paddingBottom: 10 }}
/>
<Card style={{ alignSelf: 'center', marginBottom: 20 }}>
<CreateQR content={route.params.props.name} />
</Card>

{shared.filter((share) => share.credential_id === route.params.props.id) ? (
<Card.Section
content={[
{
text: 'Beviset er ikke delt',
text80: true,
grey30: true,
text100: true,
grey40: true,
},
]}
style={{ padding: 30, paddingTop: 10, paddingBottom: 0 }}
Expand All @@ -80,33 +89,27 @@ export default function VerifierLogFrame({ route }) {
text: `Beviset er delt med: ${shared
.filter((share) => share.credential_id === route.params.props.id)
.map((share) => share.verifier)}`,
text80: true,
grey30: true,
text100: true,
grey40: true,
},
]}
style={{ padding: 30, paddingTop: 10, paddingBottom: 0 }}
/>
)}
<Card.Section
content={[{ text: 'Del beviset med QR-kode: ', text80: true, grey30: true }]}
style={{ padding: 30, paddingTop: 10, paddingBottom: 5 }}

<Button
label="Slett bevis"
color="rgb(194,19,44)"
backgroundColor="white"
size={Button.sizes.small}
style={{ marginTop: 100, marginBottom: 15 }}
onPress={() => {
// dispatch(removeCredential(props.id));
removeItemValue(route.params.props.id);
navigation.navigate('Oversikt');
}}
text90
/>
<View style={{ alignSelf: 'center', paddingBottom: 20 }}>
<CreateQR content={route.params.props.name} />
<Button
label="Slett bevis"
color="rgb(194,19,44)"
backgroundColor="white"
size={Button.sizes.small}
style={{ marginTop: 150 }}
onPress={() => {
// dispatch(removeCredential(props.id));
removeItemValue(route.params.props.id);
navigation.navigate('Oversikt');
}}
text90
/>
</View>
{/*
<CreateQR style={{ margin: 25 }} content={route.params.props.name} />
*/}
Expand Down