From c0670c86cad129de805a800466c24796e9e6d4b6 Mon Sep 17 00:00:00 2001 From: balzack Date: Wed, 18 Sep 2024 22:24:23 -0700 Subject: [PATCH] adding profile details to settings --- app/client/mobile/src/access/Access.tsx | 1 - .../mobile/src/settings/Settings.styled.ts | 65 +++++++++++++-- app/client/mobile/src/settings/Settings.tsx | 80 +++++++++++++++---- 3 files changed, 126 insertions(+), 20 deletions(-) diff --git a/app/client/mobile/src/access/Access.tsx b/app/client/mobile/src/access/Access.tsx index 58fd3411..93b5984f 100644 --- a/app/client/mobile/src/access/Access.tsx +++ b/app/client/mobile/src/access/Access.tsx @@ -2,7 +2,6 @@ import React, {useState} from 'react'; import { Platform, KeyboardAvoidingView, - ScrollView, View, Image, } from 'react-native'; diff --git a/app/client/mobile/src/settings/Settings.styled.ts b/app/client/mobile/src/settings/Settings.styled.ts index 26a12543..e44fb3bf 100644 --- a/app/client/mobile/src/settings/Settings.styled.ts +++ b/app/client/mobile/src/settings/Settings.styled.ts @@ -2,11 +2,10 @@ import {StyleSheet} from 'react-native'; export const styles = StyleSheet.create({ settings: { + position: 'relative', display: 'flex', flexDirection: 'column', alignItems: 'center', - padding: 8, - gap: 2, }, header: { fontSize: 22, @@ -19,8 +18,8 @@ export const styles = StyleSheet.create({ position: 'relative', width: '90%', maxWidth: 250, - marginTop: 8, - marginBottom: 24, + marginTop: 16, + marginBottom: 8, }, logo: { aspectRatio: 1, @@ -37,9 +36,65 @@ export const styles = StyleSheet.create({ justifyContent: 'center', alignItems: 'center', }, - editLogo: { + setLogo: { fontSize: 18, borderRadius: 8, backgroundColor: '#44444444', }, + unsetLogo: { + color: '#888888', + fontSize: 18, + }, + editDivider: { + paddingLeft: 16, + paddingRight: 16, + display: 'flex', + flexDirection: 'row', + alignItems: 'center', + minHeight: 32, + }, + divider: { + flexGrow: 1, + }, + nameSet: { + fontSize: 28, + width: '100%', + paddingLeft: 32, + paddingRight: 32, + }, + nameUnset: { + fontSize: 28, + width: '100%', + paddingLeft: 32, + paddingRight: 32, + fontStyle: 'italic', + }, + attributes: { + display: 'flex', + flexDirection: 'column', + gap: 8, + width: '100%', + }, + attribute: { + display: 'flex', + flexDirection: 'row', + alignItem: 'center', + justifyContent: 'center', + paddingLeft: 32, + paddingRight: 32, + }, + icon: { + width: 32, + display: 'flex', + justifyContent: 'center', + }, + labelUnset: { + fontSize: 18, + fontStyle: 'italic', + flexGrow: 1, + }, + labelSet: { + fontSize: 18, + flexGrow: 1, + }, }) diff --git a/app/client/mobile/src/settings/Settings.tsx b/app/client/mobile/src/settings/Settings.tsx index ce383dee..203a894e 100644 --- a/app/client/mobile/src/settings/Settings.tsx +++ b/app/client/mobile/src/settings/Settings.tsx @@ -1,28 +1,80 @@ import React, {useContext} from 'react'; -import {Button, Text} from 'react-native-paper'; -import {SafeAreaView, View, Image} from 'react-native'; +import {Button, Text, Divider, Icon} from 'react-native-paper'; +import {SafeAreaView, TouchableOpacity, View, Image, ScrollView} from 'react-native'; import {styles} from './Settings.styled'; import {useSettings} from './useSettings.hook'; export function Settings() { const { state, actions } = useSettings(); -console.log("HERE"); + const SelectImage = async () => { + } return ( - - {`${state.profile.handle}${state.profile.node ? '/' + state.profile.node : ''}`} - - - - + + + {`${state.profile.handle}${state.profile.node ? '/' + state.profile.node : ''}`} + { state.profile.imageSet && ( + + + + + + + )} + { !state.profile.imageSet && ( + + + + {state.strings.edit} + + + )} + + + + - + + {!state.profile.name && ( + {state.strings.name} + )} + {state.profile.name && ( + {state.profile.name} + )} + + + + + {!state.profile.location && ( + {state.strings.location} + )} + {state.profile.location && ( + {state.profile.location} + )} + + + + + + {!state.profile.description && ( + {state.strings.description} + )} + {state.profile.description && ( + {state.profile.description} + )} + + - - + + + + + + + ); }