diff --git a/app/mobile/src/session/registry/Registry.jsx b/app/mobile/src/session/registry/Registry.jsx index 557b093b..9985e4ea 100644 --- a/app/mobile/src/session/registry/Registry.jsx +++ b/app/mobile/src/session/registry/Registry.jsx @@ -55,11 +55,20 @@ export function RegistryTitle({ state, actions }) { export function RegistryBody({ state, actions, openContact }) { return ( - } - keyExtractor={item => item.guid} - /> + + { state.accounts.length === 0 && state.searcheg && ( + + No Contacts Found + + )} + { state.accounts.length !== 0 && ( + } + keyExtractor={item => item.guid} + /> + )} + ); } @@ -104,11 +113,18 @@ export function Registry({ closeRegistry, openContact }) { - } - keyExtractor={item => item.guid} - /> + { state.accounts.length === 0 && state.searched && ( + + No Contacts Found + + )} + { state.accounts.length !== 0 && ( + } + keyExtractor={item => item.guid} + /> + )} )} { !state.tabbed && ( @@ -134,11 +150,18 @@ export function Registry({ closeRegistry, openContact }) { - } - keyExtractor={item => item.guid} - /> + { state.accounts.length === 0 && state.searched && ( + + No Contacts Found + + )} + { state.accounts.length !== 0 && ( + } + keyExtractor={item => item.guid} + /> + )} )} diff --git a/app/mobile/src/session/registry/Registry.styled.js b/app/mobile/src/session/registry/Registry.styled.js index 2493ea12..0f726e08 100644 --- a/app/mobile/src/session/registry/Registry.styled.js +++ b/app/mobile/src/session/registry/Registry.styled.js @@ -79,9 +79,19 @@ export const styles = StyleSheet.create({ flexShrink: 1, width: '100%', paddingLeft: 16, - paddingRight: 16, minHeight: 0, }, + empty: { + flexGrow: 1, + width: '100%', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + }, + emptyText: { + color: Colors.grey, + fontSize: 16, + }, addbottom: { marginRight: 8, display: 'flex', diff --git a/app/mobile/src/session/registry/useRegistry.hook.js b/app/mobile/src/session/registry/useRegistry.hook.js index 26a53664..0ff38b50 100644 --- a/app/mobile/src/session/registry/useRegistry.hook.js +++ b/app/mobile/src/session/registry/useRegistry.hook.js @@ -14,6 +14,7 @@ export function useRegistry() { server: null, filter: false, username: null, + searched: false, busy: false, }); @@ -63,8 +64,7 @@ export function useRegistry() { return true; }); const items = filtered.map(setAccountItem); - items.push({guid:''}); - updateState({ busy: false, accounts: items }); + updateState({ busy: false, searched: true, accounts: items }); } catch (err) { console.log(err); @@ -78,7 +78,7 @@ export function useRegistry() { const actions = { setServer: (server) => { - updateState({ server, accounts: [] }); + updateState({ server, searched: false, accounts: [] }); }, search: async () => { await getAccounts(state.server, false);