Skip to content

Commit

Permalink
tweak walletconnect qrcode styles #5285
Browse files Browse the repository at this point in the history
  • Loading branch information
2nthony committed Feb 18, 2025
1 parent 955a6df commit 48a23f9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/next-common/components/login/web3/walletconnect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import qrcode from "qrcode";
import { useEffect, useState } from "react";
import { useInterval, useUnmount } from "react-use";

const SIZE = 300;
const SIZE = 200;
const REFRESH_QRCODE_INTERVAL = 4 * 60 * 1000; // 4 minutes

function Skeleton() {
return (
<div className="w-full h-full rounded-md bg-gradient-to-r from-neutral200 to-neutral200 " />
<div className="w-full h-full rounded-lg bg-gradient-to-r from-neutral300-80 to-neutral300-20 " />
);
}

Expand Down Expand Up @@ -58,7 +58,7 @@ export default function LoginWeb3WalletConnect() {
.toDataURL(uri, {
width: SIZE,
height: SIZE,
scale: 6,
margin: 0,
})
.then(setQrCode);
}, [uri]);
Expand Down Expand Up @@ -96,9 +96,14 @@ export default function LoginWeb3WalletConnect() {
<WalletGroupTitle>Scan With Your Phone</WalletGroupTitle>

<div className="flex justify-center">
<div style={{ width: SIZE, height: SIZE }}>
<div
className="rounded-xl border border-neutral300"
style={{ width: SIZE + 16, height: SIZE + 16 }}
>
{qrCode ? (
<img src={qrCode} alt="qrcode" className="rounded-md" />
<div className="p-4">
<img src={qrCode} alt="qrcode" />
</div>
) : (
<Skeleton />
)}
Expand Down
2 changes: 2 additions & 0 deletions packages/next-common/styles/dark.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const dark = {
neutral200: "#1E2130",
neutral200alpha: "#1E213080",
neutral300: "#282B3B",
"neutral300-80": "rgba(40,43,59,0.8)",
"neutral300-20": "rgba(40,43,59,0.2)",
neutral400: "rgba(54,58,77,1)",
neutral500: "rgba(87,92,114,1)",
tooltipBg: "rgba(0,0,0,0.800)",
Expand Down
2 changes: 2 additions & 0 deletions packages/next-common/styles/light.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const light = {
neutral200: "rgba(246,247,250,1)",
neutral200alpha: "rgba(246,247,250,0.5)",
neutral300: "rgba(235,238,244,1)",
"neutral300-80": "rgba(235,238,244,0.8)",
"neutral300-20": "rgba(235,238,244,0.2)",
neutral400: "rgba(224,228,235,1)",
neutral500: "rgba(194,200,212,1)",
tooltipBg: "rgba(0,0,0,0.800)",
Expand Down

0 comments on commit 48a23f9

Please sign in to comment.