Skip to content

Commit

Permalink
Update texts when app is embedded dApp
Browse files Browse the repository at this point in the history
  • Loading branch information
kkosiorowska committed Sep 20, 2024
1 parent 109d71c commit 678d151
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useCallback, useEffect, useState } from "react"
import { CONNECTION_ERRORS, ONE_SEC_IN_MILLISECONDS } from "#/constants"
import {
useAppDispatch,
useIsEmbed,
useModal,
useSignMessageAndCreateSession,
useWallet,
Expand Down Expand Up @@ -54,6 +55,7 @@ export default function ConnectWalletButton({
connector,
onSuccess,
}: ConnectWalletButtonProps) {
const { isEmbed } = useIsEmbed()
const {
address,
isConnected,
Expand Down Expand Up @@ -226,7 +228,7 @@ export default function ConnectWalletButton({
</TextMd>
<ConnectWalletStatusLabel
status={connectionStatus}
label="Connect wallet"
label={`Connect ${isEmbed ? "account" : "wallet"}`}
/>
<ConnectWalletStatusLabel
status={signMessageStatus}
Expand Down
5 changes: 3 additions & 2 deletions dapp/src/components/Header/ConnectWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
useClipboard,
useMultiStyleConfig,
} from "@chakra-ui/react"
import { useModal, useWallet } from "#/hooks"
import { useIsEmbed, useModal, useWallet } from "#/hooks"
import { CurrencyBalance } from "#/components/shared/CurrencyBalance"
import { TextMd } from "#/components/shared/Typography"
import { BitcoinIcon } from "#/assets/icons"
Expand All @@ -20,6 +20,7 @@ import { MODAL_TYPES } from "#/types"
import { IconCopy, IconLogout, IconWallet } from "@tabler/icons-react"

export default function ConnectWallet() {
const { isEmbed } = useIsEmbed()
const { address, balance, onDisconnect } = useWallet()
const { isOpenGlobalErrorModal, modalType, openModal } = useModal()
const { hasCopied, onCopy } = useClipboard(address ?? "")
Expand All @@ -45,7 +46,7 @@ export default function ConnectWallet() {
pointerEvents: "none",
})}
>
Connect wallet
{`Connect ${isEmbed ? "account" : "wallet"}`}
</Button>
)
}
Expand Down

0 comments on commit 678d151

Please sign in to comment.