From be27dfa0cc17a0b0ffd4eac51d84313660ea3031 Mon Sep 17 00:00:00 2001 From: Bartosz Date: Mon, 4 Nov 2024 14:43:07 +0100 Subject: [PATCH] feat: connect modal layout update --- src/constants/common.ts | 18 ++++ src/icons/dapp.svg | 3 + src/popup/App.vue | 10 +- src/popup/components/Card.vue | 44 +++++---- src/popup/components/InfoBox.vue | 4 +- src/popup/locales/en.json | 6 +- src/popup/pages/AppsBrowser.vue | 20 +--- src/popup/pages/Popups/Connect.vue | 154 +++++++++++++++++++---------- 8 files changed, 168 insertions(+), 91 deletions(-) create mode 100644 src/icons/dapp.svg diff --git a/src/constants/common.ts b/src/constants/common.ts index 964ceaa56..c65027a14 100644 --- a/src/constants/common.ts +++ b/src/constants/common.ts @@ -466,6 +466,24 @@ export const BROWSER_ACTIONS = { favourite: 'favourite', } as const; +export const DAPPS_LIST = [ + { + title: 'Aeternity Governance', + url: 'https://governance.aeternity.com/', + image: 'Governance.webp', + }, + { + title: 'Graffiti Aepp', + url: 'https://graffiti.aeternity.com', + image: 'graffiti.svg', + }, + { + title: 'Superhero DEX', + url: 'https://aepp.dex.superhero.com/swap', + image: 'SuperheroDEX.svg', + }, +]; + export const PAGE_TRANSITION_DURATION = 150; export const MAX_BROWSER_HISTORY_ITEMS = 10; diff --git a/src/icons/dapp.svg b/src/icons/dapp.svg new file mode 100644 index 000000000..fef2ef6fc --- /dev/null +++ b/src/icons/dapp.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/popup/App.vue b/src/popup/App.vue index 953dcca3c..36299b6a9 100644 --- a/src/popup/App.vue +++ b/src/popup/App.vue @@ -87,6 +87,7 @@ import { IS_FIREFOX, RUNNING_IN_POPUP, RUNNING_IN_TESTS, + MODAL_CONFIRM_CONNECT, } from '@/constants'; import { watchUntilTruthy } from '@/utils'; import { ROUTE_ACCOUNT } from '@/popup/router/routeNames'; @@ -135,7 +136,7 @@ export default defineComponent({ isLoaderVisible, initVisibilityListeners, } = useUi(); - const { modalsOpen } = useModals(); + const { modalsOpen, openModal } = useModals(); const { isLoggedIn } = useAccounts(); const { addWalletNotification } = useNotifications(); const { loadCoinsData } = useCurrencies({ pollingDisabled: true }); @@ -285,6 +286,13 @@ export default defineComponent({ loadCoinsData(); } + // TODO remove + setTimeout(() => { + openModal(MODAL_CONFIRM_CONNECT, { + app: { host: 'http://test.com', url: 'https://aepp.dex.superhero.com/swap', name: 'Test app' }, + }); + }, 100); + watchUntilTruthy(isLoggedIn).then(() => { setTimeout(() => { verifyBackedUpSeed(); diff --git a/src/popup/components/Card.vue b/src/popup/components/Card.vue index 7e6ee3b01..198349882 100644 --- a/src/popup/components/Card.vue +++ b/src/popup/components/Card.vue @@ -9,20 +9,27 @@ }" :style="styleComponent" > - + + +
-
- {{ text }} -
-
- {{ description }} -
+
+
+
@@ -54,8 +61,8 @@ export default defineComponent({ IconWrapper, }, props: { - text: { type: String, required: true }, - description: { type: String, required: true }, + text: { type: String, default: null }, + description: { type: String, default: null }, background: { type: String, default: null }, cardId: { type: String as PropType, default: null }, icon: { type: Object, default: null }, @@ -96,9 +103,9 @@ export default defineComponent({ z-index: 1; position: relative; display: flex; - align-items: flex-start; + align-items: center; width: 100%; - min-height: 116px; + // min-height: 116px; border-radius: $border-radius-interactive; padding: 20px 16px; gap: 16px; @@ -141,8 +148,11 @@ export default defineComponent({ } &.dense { + padding: 10px; + gap: 8px; + .description { - margin-top: 0; + margin-top: 1px; } } diff --git a/src/popup/components/InfoBox.vue b/src/popup/components/InfoBox.vue index d1aa5a6df..34138f348 100644 --- a/src/popup/components/InfoBox.vue +++ b/src/popup/components/InfoBox.vue @@ -8,7 +8,7 @@