Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Metroxe committed Feb 10, 2024
2 parents dffa319 + be88e0a commit b1593b2
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions apps/web-connect/src/features/wallet/routes/RedEnvelope2024.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useAccount, useContractRead, useContractWrite, useNetwork} from "wagmi";
import {useAccount, useContractRead, useNetwork} from "wagmi";
import {useListNodeLicenses} from "@/hooks/useListNodeLicenses";
import {BiLoaderAlt} from "react-icons/bi";
import {useEffect, useState} from "react";
Expand All @@ -22,8 +22,8 @@ export function RedEnvelope2024() {
// check license balance
const [kycStatus, setKycStatus] = useState<{wallet: string, isKycApproved: boolean}>();
const [showInput, setShowInput] = useState(() => document.cookie.includes('showInput=true'));
const [inputError, setInputError] = useState("");
const [value, setValue] = useState("");
const [_, setInputError] = useState("");
const [value] = useState("");

useEffect(() => {
if (address) {
Expand Down Expand Up @@ -59,15 +59,15 @@ export function RedEnvelope2024() {
});
console.log("isTwitterPostSubmittedData:", isTwitterPostSubmittedData)

const {isLoading: isSubmitClaimRequestLoading, write, error, isSuccess: isSubmitClaimRequestSuccess} = useContractWrite({
address: config.xaiRedEnvelope2024Address as `0x${string}`,
abi: xaiRedEnvelopeAbi,
functionName: "submitClaimRequest",
args: [value],
onError(error) {
console.warn("Error", error);
},
});
// const {isLoading: isSubmitClaimRequestLoading, write, error, isSuccess: isSubmitClaimRequestSuccess} = useContractWrite({
// address: config.xaiRedEnvelope2024Address as `0x${string}`,
// abi: xaiRedEnvelopeAbi,
// functionName: "submitClaimRequest",
// args: [value],
// onError(error) {
// console.warn("Error", error);
// },
// });

if (loadingGeo) {
return (
Expand All @@ -83,15 +83,15 @@ export function RedEnvelope2024() {
);
}

function attemptSubmit() {
setInputError("");
// function attemptSubmit() {
// setInputError("");

if (validateTweet(value)) {
write();
} else {
setInputError("Please enter a URL to a valid tweet.");
}
}
// if (validateTweet(value)) {
// write();
// } else {
// setInputError("Please enter a URL to a valid tweet.");
// }
// }

function validateTweet(tweet: string): boolean {
return tweet.indexOf("twitter.com") > -1 || tweet.indexOf("x.com") > -1;
Expand Down

0 comments on commit b1593b2

Please sign in to comment.