Embed React improvements (#2782)
* Add off support. Add getApi export. * Add publish command * Add embed-snippet in prod deps * Update README * Update package.json Co-authored-by: Bailey Pumfleet <pumfleet@hey.com> Co-authored-by: zomars <zomars@me.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
10 files changed
+64
-14
No files matched your search
@@ -1,8 +1,7 @@
|
||||
import Router from "next/router";
|
||||
import { useCallback, useMemo, useState } from "react";
|
||||
import React from "react";
|
||||
import React, { useCallback, useMemo, useState } from "react";
|
||||
import Web3 from "web3";
|
||||
import { AbstractProvider } from "web3-core";
|
||||
import type { AbstractProvider } from "web3-core";
|
||||
import { AbiItem } from "web3-utils";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
@@ -57,13 +56,12 @@ const CryptoSection = (props: CryptoSectionProps) => {
|
||||
|
||||
const contract = new window.web3.eth.Contract(genericAbi as AbiItem[], props.smartContractAddress);
|
||||
const balance = await contract.methods.balanceOf(window.ethereum.selectedAddress).call();
|
||||
|
||||
const hasToken = balance > 0;
|
||||
|
||||
if (!hasToken) {
|
||||
throw new Error("Specified wallet does not own any tokens belonging to this smart contract");
|
||||
} else {
|
||||
const account = (await window.web3.eth.getAccounts())[0];
|
||||
const [account] = await window.web3.eth.getAccounts();
|
||||
const signature = await window.web3.eth.personal.sign(AUTH_MESSAGE, account, "");
|
||||
addContract({ address: props.smartContractAddress, signature });
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { expect, Page, test } from "@playwright/test";
|
||||
import { createServer, IncomingMessage, ServerResponse } from "http";
|
||||
import noop from "lodash/noop";
|
||||
|
||||
export function todo(title: string) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
test.skip(title, () => {});
|
||||
// eslint-disable-next-line playwright/no-skipped-test
|
||||
test.skip(title, noop);
|
||||
}
|
||||
|
||||
type Request = IncomingMessage & { body?: unknown };
|
||||
|
||||
Reference in new issue
Block a user