Skip to content

Commit

Permalink
feat(wallet/frontend): use custom domain for card pp (#1773)
Browse files Browse the repository at this point in the history
use ilp.dev
  • Loading branch information
raducristianpopa authored Oct 24, 2024
1 parent 37a9b19 commit e32a139
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/wallet/frontend/src/components/WalletAddressesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ export const CopyWalletAddress = () => {
const { walletAddress } = useContext(WalletAddressRowContext)
const [isCopied, setIsCopied] = useState(false)

let pointer = walletAddress.url

if (walletAddress.isCard) {
const url = new URL(walletAddress.url)
pointer = `$ilp.dev${url.pathname}`
}

useEffect(() => {
setTimeout(() => {
setIsCopied(false)
Expand All @@ -114,11 +121,11 @@ export const CopyWalletAddress = () => {
onClick={(e) => {
e.preventDefault()
setIsCopied(true)
copyToClipboard(walletAddress.url)
copyToClipboard(pointer)
}}
>
<p className="underline decoration-dashed underline-offset-2">
{walletAddress.url}
{pointer}
</p>
</TooltipTrigger>
<TooltipContent onPointerDownOutside={(e) => e.preventDefault()}>
Expand Down Expand Up @@ -156,9 +163,7 @@ export const WalletAddressRow = ({
<td>
<EditWalletAddress />
</td>
<td>
<DeleteWalletAddress />
</td>
<td>{walletAddress.isCard ? null : <DeleteWalletAddress />}</td>
</tr>
</WalletAddressRowContext.Provider>
)
Expand Down
1 change: 1 addition & 0 deletions packages/wallet/shared/src/types/walletAddress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface IWalletAddressResponse {
url: string
publicName: string
accountId: string
isCard?: boolean
}

export interface WalletAddressResponse extends IWalletAddressResponse {
Expand Down

0 comments on commit e32a139

Please sign in to comment.