Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
alimaktabi committed Sep 13, 2024
2 parents a38ea28 + 933d3b1 commit 9874a75
Show file tree
Hide file tree
Showing 25 changed files with 118 additions and 133 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ NEXT_PUBLIC_IS_STAGE=0
SOLANA_HTTP_PROVIDER="https://fragrant-intensive-patina.solana-mainnet.quiknode.pro/08a6330aa4eb2bbad964ee86b9a271fdb5e8a7ad/"

NEXT_PUBLIC_CLOUDFLARE_TURNSITE_SITEKEY="0x4AAAAAAAiB14Mx3cWX5zwu"
H_CAPTCHA_SITEKEY="68c27f52-99c6-4832-b2b0-b5ac343a9f90"
NEXT_PUBLIC_H_CAPTCHA_SITEKEY="68c27f52-99c6-4832-b2b0-b5ac343a9f90"
2 changes: 1 addition & 1 deletion app/prizetap/components/Linea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const LineaRaffleCard: FC<{
isHighlighted?: boolean;
}> = ({ raffle, isHighlighted }) => {
const {
imageUrl,
image: imageUrl,
tokenUri,
creatorUrl,
twitterUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ const BrightNotConnectedBody: FC<{
<>
<DropIconWrapper data-testid={`chain-claim-brightid-not-connected`}>
<Icon
className="chain-logo z-10 mt-14 mb-10"
className="chain-logo z-10 mb-10 mt-14"
width="auto"
height="110px"
iconSrc={raffle.imageUrl}
iconSrc={raffle.image}
alt=""
/>
</DropIconWrapper>

<p className="text-white text-sm mb-5 mt-11">
<p className="mb-5 mt-11 text-sm text-white">
{method === "Enroll"
? "You need to connect your BrightID to enroll in raffle"
: " You need to connect your BrightID to claim your prize"}
Expand Down
2 changes: 1 addition & 1 deletion app/prizetap/components/Modals/enroll-body/InitialBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const InitialBody: FC<{
className="chain-logo z-10 mb-10 mt-14"
width="auto"
height="110px"
iconSrc={raffle.imageUrl}
iconSrc={raffle.image}
alt=""
/>
</DropIconWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const Sidebar: FC<{
<aside className="relative h-full w-[230px] rounded-lg bg-gray20 p-2 text-sm">
<div className=" relative mb-8 flex h-[112px] items-center justify-center rounded-2xl border border-gray60">
<img
src={prize.imageUrl}
src={prize.image}
width="80px"
height="140px"
className="opacity-30"
Expand Down Expand Up @@ -464,14 +464,17 @@ const PrizeRequirementBody: FC<{
></div>
</div>
)}
{constraint.name === "core.HasVerifiedHCaptcha" && (
<HCaptcha
sitekey="your-sitekey"
onVerify={(token, ekey) =>
localStorage.setItem("captcha-token", token)
}
/>
)}
<div className="mx-auto mt-5">
{constraint.name === "core.HasVerifiedHCaptcha" && (
<HCaptcha
theme="dark"
sitekey={process.env.NEXT_PUBLIC_H_CAPTCHA_SITEKEY!}
onVerify={(token, ekey) =>
localStorage.setItem("h-captcha-token", token)
}
/>
)}
</div>
</main>
<div className="mt-auto flex w-full items-center rounded-lg bg-gray20 p-2">
{checkConnections(connections, constraint.name) ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const WrongNetworkBody: FC<{
className="chain-logo z-10 mb-10 mt-14"
width="auto"
height="110px"
iconSrc={raffle!.imageUrl}
iconSrc={raffle!.image}
alt=""
/>
</DropIconWrapper>
Expand Down
2 changes: 1 addition & 1 deletion app/prizetap/components/RafflesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const RaffleCard: FC<{ raffle: Prize; isHighlighted?: boolean }> = ({
isHighlighted,
}) => {
const {
imageUrl,
image: imageUrl,
tokenUri,
creatorUrl,
twitterUrl,
Expand Down
2 changes: 1 addition & 1 deletion app/prizetap/components/permissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const RafflePermissions: FC<{ raffle: Prize }> = ({ raffle }) => {
} mx-auto h-32 w-64 rounded-lg bg-cover`}
/>
<img
src={raffle.imageUrl}
src={raffle.image}
className="absolute left-1/2 top-3 max-w-[120px] -translate-x-1/2"
alt={raffle.name}
width={100}
Expand Down
2 changes: 1 addition & 1 deletion components/containers/landing/prizeTap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const PrizeTapLanding: FC = async () => {
className="object-contain"
width="62px"
height="63px"
src={raffle.imageUrl}
src={raffle.image}
alt={raffle.name}
/>
</span>
Expand Down
2 changes: 1 addition & 1 deletion components/containers/landing/tokenTap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const TokenTapLanding = async () => {
<img
width={24}
height={24}
src={token.imageUrl}
src={token.image}
alt={token.name}
className="token-logo h-[100%] w-auto"
/>
Expand Down
40 changes: 20 additions & 20 deletions components/containers/token-tap/Modals/ClaimFailedBody.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
"use client"
"use client";

import Icon from "@/components/ui/Icon"
import { useTokenTapContext } from "@/context/tokenTapProvider"
import { Token } from "@/types"
import { FC } from "react"
import { Text } from "@/components/ui/text.style"
import { ClaimButton } from "@/components/ui/Button/button"
import { useUserProfileContext } from "@/context/userProfile"
import Icon from "@/components/ui/Icon";
import { useTokenTapContext } from "@/context/tokenTapProvider";
import { Token } from "@/types";
import { FC } from "react";
import { Text } from "@/components/ui/text.style";
import { ClaimButton } from "@/components/ui/Button/button";
import { useUserProfileContext } from "@/context/userProfile";

const ClaimFailedBody: FC<{
token: Token
token: Token;
}> = ({ token }) => {
const { nonEVMWalletAddress, setNonEVMWalletAddress } =
useUserProfileContext()
const { claimError, claimTokenLoading, claimToken } = useTokenTapContext()
useUserProfileContext();
const { claimError, claimTokenLoading, claimToken } = useTokenTapContext();

return (
<>
<Icon
data-testid="chain-logo"
className="chain-logo z-10 mt-14 mb-10"
iconSrc={token.imageUrl}
className="chain-logo z-10 mb-10 mt-14"
iconSrc={token.image}
width="auto"
height="110px"
/>
<span className="flex justify-center items-center font-medium mb-3">
<span className="mb-3 flex items-center justify-center font-medium">
<Text
className="!mb-0"
width="100%"
Expand All @@ -51,12 +51,12 @@ const ClaimFailedBody: FC<{
An error occurred while processing your request
</Text>

<p className="text-white text-sm my-4 text-center px-3 mb-6">
<p className="my-4 mb-6 px-3 text-center text-sm text-white">
{claimError}
</p>
<div className="address-input flex w-full bg-gray30 rounded-xl my-6 p-2.5 items-center">
<div className="address-input my-6 flex w-full items-center rounded-xl bg-gray30 p-2.5">
<input
className="address-input__input w-full placeholder:text-gray80 text-sm mx-1.5 bg-transparent text-white"
className="address-input__input mx-1.5 w-full bg-transparent text-sm text-white placeholder:text-gray80"
type="text"
placeholder="Paste your lightning invoice "
value={nonEVMWalletAddress}
Expand Down Expand Up @@ -87,7 +87,7 @@ const ClaimFailedBody: FC<{
{claimTokenLoading ? <p> Claiming... </p> : <p>Try Again</p>}
</ClaimButton>
</>
)
}
);
};

export default ClaimFailedBody
export default ClaimFailedBody;
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ClaimLightningContent: FC<{ chain: Chain }> = ({ chain }) => {
return (
<BrightNotConnectedBody
chainPk={selectedTokenForClaim.chain.pk}
imageUrl={selectedTokenForClaim.imageUrl}
imageUrl={selectedTokenForClaim.image}
/>
);

Expand All @@ -69,7 +69,7 @@ const ClaimLightningContent: FC<{ chain: Chain }> = ({ chain }) => {
<Icon
data-testid="chain-logo"
className="chain-logo z-10 mb-10 mt-14"
iconSrc={selectedTokenForClaim!.imageUrl}
iconSrc={selectedTokenForClaim!.image}
width="auto"
height="110px"
/>
Expand Down
4 changes: 2 additions & 2 deletions components/containers/token-tap/Modals/ClaimModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const ClaimTokenModalBody = ({
return (
<BrightNotConnectedBody
chainPk={selectedTokenForClaim.chain.pk}
imageUrl={selectedTokenForClaim.imageUrl}
imageUrl={selectedTokenForClaim.image}
/>
);

Expand Down Expand Up @@ -115,7 +115,7 @@ const ClaimTokenModalBody = ({
return (
<WrongNetworkBody
chain={selectedTokenForClaim.chain}
imageUrl={selectedTokenForClaim.imageUrl}
imageUrl={selectedTokenForClaim.image}
/>
);

Expand Down
2 changes: 1 addition & 1 deletion components/containers/token-tap/Modals/InitialBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const InitialBody: FC<{
className="chain-logo z-10 mb-10 mt-14"
width="auto"
height="110px"
iconSrc={token.imageUrl}
iconSrc={token.image}
alt=""
/>
</DropIconWrapper>
Expand Down
4 changes: 2 additions & 2 deletions components/containers/token-tap/Modals/MaxedOutBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const MaxedOutBody: FC<{
<>
<DropIconWrapper data-testid={`token-claim-maxed-out-${token.id}`}>
<Icon
className="chain-logo z-10 mt-14 mb-10"
className="chain-logo z-10 mb-10 mt-14"
width="auto"
height="110px"
iconSrc={token.imageUrl}
iconSrc={token.image}
alt={token.name}
/>
</DropIconWrapper>
Expand Down
26 changes: 13 additions & 13 deletions components/containers/token-tap/Modals/NoRemainingClaimsBody.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
"use client"
"use client";

import Icon from "@/components/ui/Icon"
import { useTokenTapContext } from "@/context/tokenTapProvider"
import { ClaimReceiptState } from "@/types"
import Icon from "@/components/ui/Icon";
import { useTokenTapContext } from "@/context/tokenTapProvider";
import { ClaimReceiptState } from "@/types";

const NotRemainingClaimsBody = () => {
const { claimedTokensList, closeClaimModal } = useTokenTapContext()
const { claimedTokensList, closeClaimModal } = useTokenTapContext();

return (
<div className="flex text-white flex-col items-center justify-center w-full pt-2">
<div className="mt-20 claim-stat__claimed rounded-lg border-2 border-gray80 bg-primaryGradient py-[2px] px-3 flex gap-x-3">
<div className="flex w-full flex-col items-center justify-center pt-2 text-white">
<div className="claim-stat__claimed mt-20 flex gap-x-3 rounded-lg border-2 border-gray80 bg-primaryGradient px-3 py-[2px]">
{claimedTokensList
.filter((claim) => claim.status !== ClaimReceiptState.REJECTED)
.map((claim, key) => {
return (
<Icon
key={key}
iconSrc={claim.tokenDistribution.imageUrl}
iconSrc={claim.tokenDistribution.image}
className={`rounded-full ${
claim.status === ClaimReceiptState.PENDING && "animated-dabe"
}`}
width="36px"
height="40px"
/>
)
);
})}
</div>
<div className="mt-10 text-center text-gray100">
Expand All @@ -32,12 +32,12 @@ const NotRemainingClaimsBody = () => {

<button
onClick={closeClaimModal}
className="w-full mt-10 py-3 border-2 text-gray100 font-normal bg-gray10 border-gray50 rounded-xl"
className="mt-10 w-full rounded-xl border-2 border-gray50 bg-gray10 py-3 font-normal text-gray100"
>
Close
</button>
</div>
)
}
);
};

export default NotRemainingClaimsBody
export default NotRemainingClaimsBody;
2 changes: 1 addition & 1 deletion components/containers/token-tap/Modals/SuccessBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const SuccessBody: FC<{
className="chain-logo z-10 mb-10 mt-14"
width="auto"
height="110px"
iconSrc={token.imageUrl}
iconSrc={token.image}
alt=""
/>
</DropIconWrapper>
Expand Down
2 changes: 1 addition & 1 deletion components/containers/token-tap/Permissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const TokenPermissions: FC<{ token: Token; onClose: () => void }> = ({
<div className="relative mb-20 text-center">
<div className="mx-auto h-40 w-64" />
<img
src={token.imageUrl}
src={token.image}
className="absolute left-1/2 top-5 -translate-x-1/2"
alt={token.name}
width={168}
Expand Down
4 changes: 2 additions & 2 deletions components/containers/token-tap/TokenCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const TokenCard: FC<{ token: Token; isHighlighted?: boolean }> = ({
options: {
decimals: token.decimals ?? token.chain.decimals,
symbol: token.token,
image: token.imageUrl,
image: token.image,
address: token.tokenAddress,
},
type: "ERC20",
Expand Down Expand Up @@ -140,7 +140,7 @@ const TokenCard: FC<{ token: Token; isHighlighted?: boolean }> = ({
height={44}
className="chain-logo h-full w-auto"
src={
token.imageUrl ?? "/assets/images/prizetap/bright-token.svg"
token.image ?? "/assets/images/prizetap/bright-token.svg"
}
unoptimized={true}
alt={token.name}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"@hcaptcha/react-hcaptcha": "^1.11.0",
"@metamask/logo": "^3.1.2",
"@sentry/nextjs": "7.105.0",
"@solana/web3.js": "^1.89.1",
"@solana/web3.js": "^1.89.2",
"@tanstack/react-query": "^5.17.12",
"@uniswap/sdk-core": "^4.0.9",
"axios": "^1.5.1",
"axios": "^1.7.4",
"big.js": "^6.2.1",
"bigint-buffer": "^1.1.5",
"bignumber.js": "^9.1.2",
Expand Down
2 changes: 1 addition & 1 deletion types/prizetap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type Prize = {
pk: PK;
constraintParams: string;
constraints: Permission[];
imageUrl: string;
image: string;
tokenUri: string;
background: string;
creator: string;
Expand Down
2 changes: 1 addition & 1 deletion types/tokentap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type Token = {
distributorUrl: string;
discordUrl: string;
twitterUrl: string;
imageUrl: string;
image: string;
token: string;
tokenAddress: string;
amount: number;
Expand Down
Loading

0 comments on commit 9874a75

Please sign in to comment.