Skip to content

Commit

Permalink
fix: bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
irisdv committed Aug 13, 2024
1 parent c320234 commit f5097de
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 37 deletions.
19 changes: 10 additions & 9 deletions app/components/claimXTicket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,20 @@ const ClaimXTicket: FunctionComponent<ClaimXTicketProps> = ({
return (
<>
{isConnected && !isFinished && hasClaimedX !== undefined && address ? (
<div className={styles.statsSection}>
<p>Retweet to get an extra ticket</p>
<div className={styles.statsSection} style={{ marginTop: "10px" }}>
<p>Claim your extra ticket</p>
{!hasClaimedX ? (
<Button
onClick={() => getExtraTicket(address)}
icon={
<img
src="/visuals/twitterIcon.svg"
alt="Twitter Icon"
width={20}
/>
}
// icon={
// <img
// src="/visuals/twitterIcon.svg"
// alt="Twitter Icon"
// width={20}
// />
// }
width={width}
variation="white"
>
Claim
</Button>
Expand Down
9 changes: 0 additions & 9 deletions app/components/extraClickModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type ExtraClickModalProps = {
closeModal: () => void;
open: boolean;
network?: NetworkType;
addrOrName?: string;
address?: string;
hasClaimed2FA?: boolean;
claim2FATicket: () => void;
Expand All @@ -25,7 +24,6 @@ const ExtraClickModal: FunctionComponent<ExtraClickModalProps> = ({
closeModal,
open,
network,
addrOrName,
address,
hasClaimed2FA,
claim2FATicket,
Expand All @@ -34,7 +32,6 @@ const ExtraClickModal: FunctionComponent<ExtraClickModalProps> = ({
setHasClaimedX,
}) => {
const [hasClicked, setHasClicked] = useState(false);
const btnIcon = <img src="/visuals/starknetIcon.svg" />;

const modalTitle =
hasClaimed2FA && hasClaimedX ? (
Expand Down Expand Up @@ -77,12 +74,6 @@ const ExtraClickModal: FunctionComponent<ExtraClickModalProps> = ({
{modalTitle}
</div>

{addrOrName ? (
<Button icon={btnIcon} width={260} variation="white">
{addrOrName}
</Button>
) : null}

{!hasClaimed2FA ? (
<>
<div className={styles.description}>
Expand Down
20 changes: 2 additions & 18 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Button from "./components/button";
import EthButton from "./components/ethButton";
import Stats from "./components/stats";
import Countdown from "./components/countdown";
import { Suspense, useEffect, useMemo, useState } from "react";
import { useEffect, useMemo, useState } from "react";
import { useAccount, useConnect, useDisconnect } from "@starknet-react/core";
import { NetworkType, RemainingClicks } from "@/constants/types";
import ConnectModal from "./components/connection/connectModal";
Expand Down Expand Up @@ -68,7 +68,6 @@ import LeaderboardWrapper from "./components/leaderboard/leaderboardWrapper";
import VideoBackground from "./components/videoBackground";
import getWalletType from "@/hooks/getWalletType";
import CountdownWithDays from "./components/countdownWithDays";
import ClaimXTicket from "./components/claimXTicket";
import ExtraClickModal from "./components/extraClickModal";

export default function Home() {
Expand Down Expand Up @@ -464,7 +463,6 @@ export default function Home() {
txVersion as number,
deploymentData
);
console.log("virtualTxId", virtualTxId);
if (!virtualTxId && !virtualTxId.virtual_tx_id) {
setErrorMsg("Error while resetting eth button");
setShowErrorMsg(true);
Expand Down Expand Up @@ -510,7 +508,6 @@ export default function Home() {
txVersion as number,
deploymentData
);
console.log("virtualTxId", virtualTxId);
if (!virtualTxId && !virtualTxId.virtual_tx_id) {
setErrorMsg("Error while resetting eth button");
setShowErrorMsg(true);
Expand Down Expand Up @@ -625,6 +622,7 @@ export default function Home() {

const claim2FATicket = () => {
if (!walletType || network === NetworkType.EVM || !address) return;
console.log("walletType", walletType);
claim2FATicketQuery(address, walletType)
.then((res) => {
if (res.error) {
Expand Down Expand Up @@ -677,19 +675,6 @@ export default function Home() {
</>
) : (
<>
<Suspense>
<div className={styles.remainingClicksMobile}>
<ClaimXTicket
isConnected={isConnected}
isFinished={isFinished}
hasClaimedX={hasClaimedX}
address={address}
showClaimed={false}
width={230}
setHasClaimedX={setHasClaimedX}
/>
</div>
</Suspense>
<Button
onClick={connectBtnAction}
icon={
Expand Down Expand Up @@ -807,7 +792,6 @@ export default function Home() {
closeModal={() => setExtraClickModal(false)}
open={extraClickModal}
network={network}
addrOrName={getConnectionBtnText()}
address={address}
hasClaimed2FA={hasClaimed2FA}
claim2FATicket={claim2FATicket}
Expand Down
1 change: 0 additions & 1 deletion services/apiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
GetDeploymentDataResult,
WalletType,
} from "@/constants/types";
import { getError } from "@/utils/stringService";
import { Signature, stark } from "starknet";

const baseurl = process.env.NEXT_PUBLIC_ETH_BUTTON_API;
Expand Down

0 comments on commit f5097de

Please sign in to comment.