From 9c24064c4e79f1813d0c1dec7b418d8c8d80173c Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Thu, 13 Oct 2022 11:22:14 -0700 Subject: [PATCH] preparing admin dashboard modals --- app/mobile/src/dashboard/Dashboard.jsx | 8 +++---- app/mobile/src/dashboard/Dashboard.styled.js | 10 +++++---- app/mobile/src/dashboard/useDashboard.hook.js | 21 +++++++++++++++++++ 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/app/mobile/src/dashboard/Dashboard.jsx b/app/mobile/src/dashboard/Dashboard.jsx index 17dbe3a7..52ef80fa 100644 --- a/app/mobile/src/dashboard/Dashboard.jsx +++ b/app/mobile/src/dashboard/Dashboard.jsx @@ -16,10 +16,10 @@ export function Dashboard(props) { Accounts - - + + - + @@ -31,7 +31,7 @@ export function Dashboard(props) { keyExtractor={item => item.accountId} renderItem={({ item }) => ( - + { item.name } { item.handle } diff --git a/app/mobile/src/dashboard/Dashboard.styled.js b/app/mobile/src/dashboard/Dashboard.styled.js index 560e970c..1666b890 100644 --- a/app/mobile/src/dashboard/Dashboard.styled.js +++ b/app/mobile/src/dashboard/Dashboard.styled.js @@ -20,7 +20,7 @@ export const styles = StyleSheet.create({ }, headerLabel: { paddingLeft: 16, - fontSize: 24, + fontSize: 20, color: Colors.text, }, icon: { @@ -43,12 +43,14 @@ export const styles = StyleSheet.create({ }, account: { width: '100%', - height: 64, + height: 48, display: 'flex', flexDirection: 'row', paddingLeft: 24, paddingRight: 24, alignItems: 'center', + borderBottomWidth: 1, + borderColor: Colors.divider, }, details: { paddingLeft: 16, @@ -59,11 +61,11 @@ export const styles = StyleSheet.create({ paddingTop: 8, }, name: { - fontSize: 16, + fontSize: 14, color: Colors.text, }, handle: { - fontSize: 16, + fontSize: 14, color: Colors.text, }, control: { diff --git a/app/mobile/src/dashboard/useDashboard.hook.js b/app/mobile/src/dashboard/useDashboard.hook.js index 757ba362..652934df 100644 --- a/app/mobile/src/dashboard/useDashboard.hook.js +++ b/app/mobile/src/dashboard/useDashboard.hook.js @@ -12,6 +12,9 @@ export function useDashboard(config, server, token) { const [state, setState] = useState({ config: null, accounts: [], + editConfig: false, + addUser: false, + accessUser: false, }); const navigate = useNavigate(); @@ -46,6 +49,24 @@ export function useDashboard(config, server, token) { logout: () => { navigate('/admin'); }, + showEditConfig: () => { + updateState({ editConfig: true }); + }, + hideEditConfig: () => { + updateState({ editConfig: false }); + }, + showAddUser: () => { + updateState({ addUser: true }); + }, + hideAddUser: () => { + updateState({ addUser: false }); + }, + showAccessUser: () => { + updateState({ accessUser: true }); + }, + hideAccessUser: () => { + updateState({ accessUser: false }); + }, }; return { state, actions };