From 5171f05d306cd947105ea9d6b1f9e52c3936be61 Mon Sep 17 00:00:00 2001 From: Jan Marcano Date: Mon, 8 Aug 2022 12:19:19 -0300 Subject: [PATCH 1/3] Move Contacts out of Settings Menu --- packages/ui/src/components/MainHeader.ts | 2 + packages/ui/src/components/OpenContacts.ts | 21 ++ packages/ui/src/components/SettingsMenu.ts | 18 +- packages/ui/src/index.js | 2 + .../ContactList.ts => pages/ContactsPage.ts} | 185 ++++++++++-------- 5 files changed, 133 insertions(+), 95 deletions(-) create mode 100644 packages/ui/src/components/OpenContacts.ts rename packages/ui/src/{components/ContactList.ts => pages/ContactsPage.ts} (61%) diff --git a/packages/ui/src/components/MainHeader.ts b/packages/ui/src/components/MainHeader.ts index 0b47163a..4d75970f 100644 --- a/packages/ui/src/components/MainHeader.ts +++ b/packages/ui/src/components/MainHeader.ts @@ -3,6 +3,7 @@ import { html } from 'htm/preact'; import HeaderComponent from './HeaderComponent'; import LedgerSelect from './LedgerSelect'; +import OpenContacts from './OpenContacts'; import SettingsMenu from './SettingsMenu'; import Logo from './Logo'; @@ -11,6 +12,7 @@ const MainHeader: FunctionalComponent = () => { <${HeaderComponent}> <${Logo} /> <${LedgerSelect} /> + <${OpenContacts} /> <${SettingsMenu} /> `; diff --git a/packages/ui/src/components/OpenContacts.ts b/packages/ui/src/components/OpenContacts.ts new file mode 100644 index 00000000..d8f27be7 --- /dev/null +++ b/packages/ui/src/components/OpenContacts.ts @@ -0,0 +1,21 @@ +import { FunctionalComponent } from 'preact'; +import { html } from 'htm/preact'; +import { Link } from 'preact-router'; + +const OpenContacts: FunctionalComponent = () => { + return html` + <${Link} + id="contactsList" + class="has-tooltip-arrow has-tooltip-bottom has-tooltip-bottom-right has-tooltip-fade has-text-centered has-text-grey-dark" + data-tooltip="Contacts List" + style="min-width: 24px;" + href=${'/contacts-page'} + > + + + + + `; +}; + +export default OpenContacts; diff --git a/packages/ui/src/components/SettingsMenu.ts b/packages/ui/src/components/SettingsMenu.ts index 7864c0c8..fbbdee27 100644 --- a/packages/ui/src/components/SettingsMenu.ts +++ b/packages/ui/src/components/SettingsMenu.ts @@ -6,7 +6,6 @@ import { JsonRpcMethod } from '@algosigner/common/messaging/types'; import { StoreContext } from 'services/StoreContext'; import HeaderComponent from './HeaderComponent'; -import ContactList from 'components/ContactList'; import DeleteWallet from 'components/DeleteWallet'; import Logo from './Logo'; import { sendMessage } from 'services/Messaging'; @@ -45,8 +44,6 @@ const SettingsMenu: FunctionalComponent = () => { const getSubmenu = () => { switch (currentMenu) { - case 'contactList': - return html`<${ContactList} />`; case 'networkConfiguration': return html`<${LedgerNetworksConfiguration} closeFunction=${() => { @@ -64,7 +61,13 @@ const SettingsMenu: FunctionalComponent = () => { }; return html` -
+