diff --git a/storybook/pages/ConnectDappModalPage.qml b/storybook/pages/ConnectDappModalPage.qml new file mode 100644 index 0000000000..33293b7525 --- /dev/null +++ b/storybook/pages/ConnectDappModalPage.qml @@ -0,0 +1,13 @@ +import QtQuick 2.15 + +import shared.popups.walletconnect 1.0 + +Item { + id: root + + ConnectDappModal { + id: dappModal + + visible: true + } +} \ No newline at end of file diff --git a/storybook/pages/ConnectedDappsButtonPage.qml b/storybook/pages/ConnectedDappsButtonPage.qml index 0fdc56c505..0829d8ef00 100644 --- a/storybook/pages/ConnectedDappsButtonPage.qml +++ b/storybook/pages/ConnectedDappsButtonPage.qml @@ -18,7 +18,10 @@ import AppLayouts.Wallet.controls 1.0 import SortFilterProxyModel 0.2 +import shared.popups.walletconnect 1.0 + import utils 1.0 +import shared.stores 1.0 Item { id: root @@ -46,7 +49,7 @@ Item { spacing: 8 onConnectDapp: { - console.warn("TODO: run ConnectDappPopup...") + console.warn("TODO: run ConnectDappModal...") } } } @@ -56,10 +59,33 @@ Item { ColumnLayout { id: optionsSpace + RowLayout { + Text { text: "projectId" } + Text { + id: projectIdText + readonly property string projectId: SystemUtils.getEnvVar("WALLET_CONNECT_PROJECT_ID") + text: projectId.substring(0, 3) + "..." + projectId.substring(projectId.length - 3) + font.bold: true + } + } + // spacer ColumnLayout {} } } + + DAppsStore { + wCSDK: WalletConnectSDK { + active: true + + projectId: projectIdText.projectId + + onSessionRequestEvent: (details) => { + // TODO #14556 + console.debug(`@dd onSessionRequestEvent: ${JSON.stringify(details)}`) + } + } + } } // category: Popups diff --git a/storybook/stubs/AppLayouts/Wallet/views/walletconnect/src/index.html b/storybook/stubs/AppLayouts/Wallet/views/walletconnect/src/index.html deleted file mode 100644 index dba7580200..0000000000 --- a/storybook/stubs/AppLayouts/Wallet/views/walletconnect/src/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - -
- - - - - - diff --git a/storybook/stubs/nim/sectionmocks/FeatureFlags.qml b/storybook/stubs/nim/sectionmocks/FeatureFlags.qml new file mode 100644 index 0000000000..ca61597349 --- /dev/null +++ b/storybook/stubs/nim/sectionmocks/FeatureFlags.qml @@ -0,0 +1,10 @@ +// Mock of src/app/global/feature_flags.nim +import QtQuick 2.15 + +QtObject { + readonly property string contextPropertyName: "featureFlagsRootContextProperty" + + // + // Silence warnings + readonly property bool dappsEnabled: true +} diff --git a/storybook/stubs/shared/stores/DAppsStore.qml b/storybook/stubs/shared/stores/DAppsStore.qml new file mode 100644 index 0000000000..c9d342cf52 --- /dev/null +++ b/storybook/stubs/shared/stores/DAppsStore.qml @@ -0,0 +1,9 @@ +import QtQuick 2.15 + +import shared.popups.walletconnect 1.0 + +QtObject { + id: root + + required property WalletConnectSDK wCSDK +} diff --git a/storybook/stubs/shared/stores/qmldir b/storybook/stubs/shared/stores/qmldir index f7439fc0fd..32ad554d67 100644 --- a/storybook/stubs/shared/stores/qmldir +++ b/storybook/stubs/shared/stores/qmldir @@ -3,4 +3,5 @@ CurrenciesStore 1.0 CurrenciesStore.qml NetworkConnectionStore 1.0 NetworkConnectionStore.qml singleton RootStore 1.0 RootStore.qml TokenBalanceHistoryStore 1.0 TokenBalanceHistoryStore.qml -BIP39_en 1.0 BIP39_en.qml \ No newline at end of file +BIP39_en 1.0 BIP39_en.qml +DAppsStore 1.0 DAppsStore.qml \ No newline at end of file