From 78ff3ead7de3f677337a211359ee18518ed59df0 Mon Sep 17 00:00:00 2001
From: kingsleydon <10992364+kingsleydon@users.noreply.github.com>
Date: Fri, 28 Jul 2023 20:34:07 +0800
Subject: [PATCH 1/2] feat(subbridge): sygma logo
---
apps/subbridge/assets/sygma_logo.svg | 8 ++++
.../components/BridgeBody/PoweredBySygma.tsx | 37 +++++++++++++++++++
.../subbridge/components/BridgeBody/index.tsx | 7 ++++
3 files changed, 52 insertions(+)
create mode 100644 apps/subbridge/assets/sygma_logo.svg
create mode 100644 apps/subbridge/components/BridgeBody/PoweredBySygma.tsx
diff --git a/apps/subbridge/assets/sygma_logo.svg b/apps/subbridge/assets/sygma_logo.svg
new file mode 100644
index 00000000..cae2d2b6
--- /dev/null
+++ b/apps/subbridge/assets/sygma_logo.svg
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/apps/subbridge/components/BridgeBody/PoweredBySygma.tsx b/apps/subbridge/components/BridgeBody/PoweredBySygma.tsx
new file mode 100644
index 00000000..5767debe
--- /dev/null
+++ b/apps/subbridge/components/BridgeBody/PoweredBySygma.tsx
@@ -0,0 +1,37 @@
+import SygmaLogo from '@/assets/sygma_logo.svg?react'
+import {Stack, Typography, useTheme, type StackProps} from '@mui/material'
+import {type FC} from 'react'
+
+const PoweredBySygma: FC = (props) => {
+ const theme = useTheme()
+ return (
+
+
+ Powered by
+
+
+
+
+
+ )
+}
+
+export default PoweredBySygma
diff --git a/apps/subbridge/components/BridgeBody/index.tsx b/apps/subbridge/components/BridgeBody/index.tsx
index baf15b21..1ff2f085 100644
--- a/apps/subbridge/components/BridgeBody/index.tsx
+++ b/apps/subbridge/components/BridgeBody/index.tsx
@@ -25,6 +25,7 @@ import DestinationAccountInput from './DestinationAccountInput'
import DestinationAccountWarning from './DestinationAccountWarning'
import ExtraInfo from './Extra'
import LargeAmountWarning from './LargeAmountWarning'
+import PoweredBySygma from './PoweredBySygma'
const getToChainIds = (fromChainId: ChainId): ChainId[] =>
BRIDGES.find((bridge) => bridge.fromChain === fromChainId)
@@ -158,6 +159,12 @@ const BridgeBody: FC = (props) => {
)}
+
+ {(bridgeInfo.kind === 'evmSygma' ||
+ bridgeInfo.kind === 'phalaSygma') && (
+
+ )}
+
From 25429f8e3da51643f6205c8f69a3047ae90610d1 Mon Sep 17 00:00:00 2001
From: kingsleydon <10992364+kingsleydon@users.noreply.github.com>
Date: Fri, 28 Jul 2023 21:03:07 +0800
Subject: [PATCH 2/2] add deeplink for SubWallet
---
apps/app/components/WalletDialog.tsx | 31 +++++++++++++++++++---------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/apps/app/components/WalletDialog.tsx b/apps/app/components/WalletDialog.tsx
index 5587afb8..a2110a76 100644
--- a/apps/app/components/WalletDialog.tsx
+++ b/apps/app/components/WalletDialog.tsx
@@ -11,6 +11,7 @@ import {
DialogTitle,
Stack,
Typography,
+ useMediaQuery,
useTheme,
} from '@mui/material'
import {
@@ -32,6 +33,7 @@ const WalletDialog: FC = () => {
const [polkadotAccounts] = useAtom(polkadotAccountsAtom)
const [, setWallet] = useAtom(walletAtom)
const [wallets, setWallets] = useState([])
+ const isMobile = useMediaQuery(theme.breakpoints.down('md'))
const connected = polkadotAccounts !== null
@@ -51,14 +53,15 @@ const WalletDialog: FC = () => {
)
if (subwalletWallet != null) {
subwalletWallet.logo.src = subwalletLogo.src
+ if (isMobile) {
+ subwalletWallet.installUrl =
+ 'https://mobile.subwallet.app/browser?url=https%3A%2F%2Fapp.phala.network'
+ }
}
const polkadotJsWallet = sortedWallets.find(
(w) => w.extensionName === 'polkadot-js',
)
- if (
- polkadotJsWallet != null &&
- window.matchMedia('(max-width: 767px)').matches
- ) {
+ if (polkadotJsWallet != null && isMobile) {
if (
(window as {SubWallet?: {isSubWallet?: boolean}}).SubWallet
?.isSubWallet === true
@@ -83,7 +86,7 @@ const WalletDialog: FC = () => {
return () => {
unmounted = true
}
- }, [])
+ }, [isMobile])
return (