Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: WalletConnect integration, part 8, verify #2285

Merged
merged 2 commits into from
Jan 3, 2025
Merged

Conversation

dianasavvatina
Copy link
Contributor

Proposed changes

Added domain verification for WalletConnect and Beacon.
Beacon has no verification and writes "UNKNOWN" for all domains.

Types of changes

  • Bugfix
  • New feature
  • Refactor
  • Breaking change
  • UI fix

Steps to reproduce

Screenshots

Add the screenshots of how the app used to look like and how it looks now

Before Now

Checklist

  • Tests that prove my fix is effective or that my feature works have been added
  • Documentation has been added (if appropriate)
  • Screenshots are added (if any UI changes have been made)
  • All TODOs have a corresponding task created (and the link is attached to it)

Copy link

vercel bot commented Dec 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
umami-embed-iframe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 10:43am
umami-embed-iframe-ghostnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 10:43am
umami-v2-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 10:43am
umami-v2-web-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 10:43am

</ModalHeader>
{opts.requestId.sdkType === "walletconnect" ? (
<VerifyInfobox
isScam={opts.isScam ?? false}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opts.isScam is enough

</SignPageHeader>
{headerProps.requestId.sdkType === "walletconnect" ? (
<VerifyInfobox
isScam={headerProps.isScam ?? false}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

headerProps.isScam is enough

@@ -46,6 +46,10 @@ export const SessionProposalModal = ({
const { onClose } = useDynamicModalContext();
const { isLoading, handleAsyncAction } = useAsyncActionHandler();

const verifyContext: Verify.Context = proposal.verifyContext;
const isScam = verifyContext.verified.isScam ?? false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verifyContext.verified.isScam is enough

}) => (
<Box textAlign="left" data-testid="verifyinfobox">
<VStack margin="auto" marginTop="16px" marginBottom="16px" spacing="16px">
{isScam ? (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can make a builder function to get proper jsx to render

const getVerificationAlert = () => {
  const statusOptions = {
    SCAM: {
      color: "red.500",
      icon: AlertTriangleIcon,
      text: "This domain is suspected to be a SCAM. Potential threat detected."
    },
    UNKNOWN: {
      color: "yellow.500",
      icon: AlertCircleIcon,
      text: "This domain is unknown. Cannot verify it."
    },
    INVALID: {
      color: "yellow.500",
      icon: AlertTriangleIcon,
      text: "This domain is invalid."
    },
    VALID: {
      color: "green.500",
      icon: VerifiedIcon,
      text: "This domain is verified."
    }
  };
 return  (<HStack
    margin="auto"
    padding="8px"
    border="1px solid"
    borderColor={statusOptions[validationStatus].color}
    borderRadius="md"
  >
    <Icon as={statusOptions[validationStatus].icon} verticalAlign="bottom" />
    <Card marginLeft="8px">{statusOptions[validationStatus].text}</Card>
  </HStack>)
};

}) => (
<Box textAlign="left" data-testid="verifyinfobox">
<VStack margin="auto" marginTop="16px" marginBottom="16px" spacing="16px">
{isScam ? (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{isScam ? (
getVerificationAlert()

Copy link
Contributor

@OKendigelyan OKendigelyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dianasavvatina dianasavvatina merged commit 188d44e into main Jan 3, 2025
10 checks passed
@dianasavvatina dianasavvatina deleted the wc_verify branch January 3, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants