Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Jun 14, 2024
1 parent 4cfc2ad commit 43f25b9
Show file tree
Hide file tree
Showing 12 changed files with 195 additions and 194 deletions.
8 changes: 4 additions & 4 deletions app/giveaway/nft/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const NFTPage = () => {
cards.push(
<div
key={i}
className="absolute w-[250px] h-[375px] rounded-3xl shadow-2xl shadow-slate-300 border-white border-8 transition-transform"
className="absolute h-[375px] w-[250px] rounded-3xl border-8 border-white shadow-2xl shadow-slate-300 transition-transform"
style={{
transform: `rotate(${getRandomRotation()}deg) translateY(${
i * 0
Expand All @@ -51,14 +51,14 @@ const NFTPage = () => {
}}
>
{i === 4 && (
<div className="flex flex-col gap-6 justify-center items-center h-full">
<div className="flex h-full flex-col items-center justify-center gap-6">
<div className="text-8xl">
{ethAddressToSingleEmoji(address)}
</div>
<div className="justify-center">
<Button
onClick={handleMint(address)}
className="bg-white/50 hover:bg-white/100 text-black uppercase text-xs tracking-wider font-bold"
className="bg-white/50 text-xs font-bold uppercase tracking-wider text-black hover:bg-white/100"
>
mint
</Button>
Expand All @@ -79,7 +79,7 @@ const NFTPage = () => {
Go back
</Link>
</Button>
<div className="flex my-[150px] justify-center relative">
<div className="relative my-[150px] flex justify-center">
{address && renderCards()}
</div>
</div>
Expand Down
83 changes: 42 additions & 41 deletions app/giveaway/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
CircleCheck,
Coins,
Gem,
Image,
Plus,
RefreshCw,
ScanFace,
Expand Down Expand Up @@ -449,9 +450,9 @@ const GiveawayPage = () => {

return (
<div className="p-4">
<div className="grid sm:grid-cols-3 gap-x-10 mt-12">
<div className="sm:col-span-2 overflow-x-scroll">
<div className="flex items-center justify-start mt-6 mb-4 gap-1">
<div className="mt-12 grid gap-x-10 sm:grid-cols-3">
<div className="overflow-x-scroll sm:col-span-2">
<div className="mb-4 mt-6 flex items-center justify-start gap-1">
<h1 className="text-2xl font-bold leading-tight tracking-tight">
Giveaways
</h1>
Expand All @@ -464,15 +465,15 @@ const GiveawayPage = () => {
) : giveaways.length === 0 ? (
<p>No giveaways available</p>
) : (
<div className="flex flex-col w-full items-start space-y-4">
<div className="flex w-full flex-col items-start space-y-4">
{giveaways.map((giveaway, index) => (
<Card className="w-full p-6 space-y-4" key={index}>
<Card className="w-full space-y-4 p-6" key={index}>
<div>
<div className="grid gap-y-6">
<div className="grid grid-cols-2">
<div>
<div className="mb-4">{giveaway.title}</div>
<h2 className="text-gray-400 uppercase text-xs tracking-wider font-bold">
<h2 className="text-xs font-bold uppercase tracking-wider text-gray-400">
Prize
</h2>
<h3 className="text-2xl font-bold leading-tight tracking-tight">
Expand All @@ -481,14 +482,14 @@ const GiveawayPage = () => {
)} ZETA`}
</h3>
</div>
<div className="uppercase text-xs tracking-wider font-bold flex justify-end space-x-4">
<div className="flex justify-end space-x-4 text-xs font-bold uppercase tracking-wider">
<div className="flex">
{
participants[giveaway.giveawayId.toString()]
?.length
}{" "}
/ {giveaway.maxParticipants.toString()}
<UserCircleIcon className="h-4 h-4" />
<UserCircleIcon className="h-4" />
</div>
<div>
{giveawayStatus[giveaway.giveawayId.toString()] ||
Expand All @@ -498,7 +499,7 @@ const GiveawayPage = () => {
</div>
<div className="grid grid-cols-2 items-end">
<div className="space-y-2">
<h2 className="text-gray-400 uppercase text-xs tracking-wider font-bold">
<h2 className="text-xs font-bold uppercase tracking-wider text-gray-400">
Requirements to Qualify
</h2>
<div>
Expand All @@ -507,7 +508,7 @@ const GiveawayPage = () => {
pathname: "/giveaway/nft",
query: { address: giveaway.nftContract },
}}
className="flex pt-2 space-x-4 items-center"
className="flex items-center space-x-4 pt-2"
>
<div
className="flex items-center justify-center rounded-lg transition-transform"
Expand All @@ -518,7 +519,7 @@ const GiveawayPage = () => {
),
}}
>
<div className="text-2xl py-4 px-3">
<div className="px-3 py-4 text-2xl">
{ethAddressToSingleEmoji(
giveaway.nftContract
)}
Expand All @@ -532,7 +533,7 @@ const GiveawayPage = () => {
{nftOwnership[
giveaway.giveawayId.toString()
] && (
<div className="text-gray-500 text-sm flex items-center gap-1">
<div className="flex items-center gap-1 text-sm text-gray-500">
<CircleCheck className="h-4 w-4" />
<div>You already qualify</div>
</div>
Expand Down Expand Up @@ -589,21 +590,21 @@ const GiveawayPage = () => {
)}
</div>

<div className="sm:col-span-1 relative order-first sm:order-last">
<h1 className="text-2xl font-bold leading-tight tracking-tight mt-6 mb-4">
<div className="relative order-first sm:order-last sm:col-span-1">
<h1 className="mb-4 mt-6 text-2xl font-bold leading-tight tracking-tight">
New Giveaway
</h1>
<form onSubmit={handleSubmit}>
<div className="flex flex-col w-full items-start">
<div className="flex w-full flex-col items-start">
<Input
name="title"
value={formData.title}
onChange={handleInputChange}
placeholder="Title"
className="flex w-full mb-4"
className="mb-4 flex w-full"
required
/>
<div className="grid grid-cols-[1fr_auto_1fr] items-center justify-center w-full space-x-2 mb-4">
<div className="mb-4 grid w-full grid-cols-[1fr_auto_1fr] items-center justify-center space-x-2">
<Popover>
<PopoverTrigger asChild>
<Button
Expand Down Expand Up @@ -631,7 +632,7 @@ const GiveawayPage = () => {
</Popover>
<div className="mx-4">or</div>
<div className="relative">
<div className="absolute text-xs p-1 p-2 right-0 top-0 text-slate-400">
<div className="absolute right-0 top-0 p-1 text-xs text-slate-400">
{currentBlockHeight}
</div>
<Input
Expand Down Expand Up @@ -660,82 +661,82 @@ const GiveawayPage = () => {
placeholder="Max Participants"
required
/>
<h2 className="text-gray-400 uppercase text-xs tracking-wider font-bold mb-2">
<h2 className="mb-2 text-xs font-bold uppercase tracking-wider text-gray-400">
Requirements to Qualify
</h2>

<Card className="w-full px-4 py-2 flex gap-2 text-sm items-center justify-between mb-2">
<div className="flex gap-2 items-center w-full">
<Coins className="w-5 h-5" />
<Card className="mb-2 flex w-full items-center justify-between gap-2 px-4 py-2 text-sm">
<div className="flex w-full items-center gap-2">
<Image className="h-5 w-5" />
<Input
name="nftContract"
value={formData.nftContract}
onChange={handleInputChange}
className="py-0 px-1 border-0 w-full"
className="w-full border-0 px-1 py-0"
placeholder="NFT Contract Address"
required
/>
</div>
</Card>

<div className="w-full flex justify-center">
<div className="flex w-full justify-center">
<Button
variant="link"
className="text-gray-400 uppercase text-xs tracking-wider font-bold"
className="text-xs font-bold uppercase tracking-wider text-gray-400"
onClick={handleToggleShowMore}
>
{showMore ? "Collapse" : "Add requirement"}
</Button>
</div>
{showMore && (
<div className="w-full">
<Card className="w-full px-4 py-2 flex gap-2 text-sm items-center justify-between mb-2">
<Card className="mb-2 flex w-full items-center justify-between gap-2 px-4 py-2 text-sm">
<div className="flex gap-2">
<Coins className="w-5 h-5" />
<Coins className="h-5 w-5" />
<div>Own ERC-20 tokens</div>
</div>
<Button variant="ghost">
<Plus className="w-4 h-4 mr-1" />
<Plus className="mr-1 h-4 w-4" />
Add
</Button>
</Card>
<Card className="w-full px-4 py-2 flex gap-2 text-sm items-center justify-between mb-2">
<Card className="mb-2 flex w-full items-center justify-between gap-2 px-4 py-2 text-sm">
<div className="flex gap-2">
<Gem className="w-5 h-5" />
<Gem className="h-5 w-5" />
<div>XP level</div>
</div>
<Button variant="ghost">
<Plus className="w-4 h-4 mr-1" />
<Plus className="mr-1 h-4 w-4" />
Add
</Button>
</Card>
<Card className="w-full px-4 py-2 flex gap-2 text-sm items-center justify-between mb-2">
<Card className="mb-2 flex w-full items-center justify-between gap-2 px-4 py-2 text-sm">
<div className="flex gap-2">
<Twitter className="w-5 h-5" />
<Twitter className="h-5 w-5" />
<div>Twitter sign in</div>
</div>
<Button variant="ghost">
<Plus className="w-4 h-4 mr-1" />
<Plus className="mr-1 h-4 w-4" />
Add
</Button>
</Card>
<Card className="w-full px-4 py-2 flex gap-2 text-sm items-center justify-between mb-2">
<Card className="mb-2 flex w-full items-center justify-between gap-2 px-4 py-2 text-sm">
<div className="flex gap-2">
<Bitcoin className="w-5 h-5" />
<Bitcoin className="h-5 w-5" />
<div>Own Bitcoin</div>
</div>
<Button variant="ghost">
<Plus className="w-4 h-4 mr-1" />
<Plus className="mr-1 h-4 w-4" />
Add
</Button>
</Card>
<Card className="w-full px-4 py-2 flex gap-2 text-sm items-center justify-between mb-2">
<Card className="mb-2 flex w-full items-center justify-between gap-2 px-4 py-2 text-sm">
<div className="flex gap-2">
<ScanFace className="w-5 h-5" />
<ScanFace className="h-5 w-5" />
<div>Passport verification</div>
</div>
<Button variant="ghost">
<Plus className="w-4 h-4 mr-1" />
<Plus className="mr-1 h-4 w-4" />
Add
</Button>
</Card>
Expand All @@ -750,7 +751,7 @@ const GiveawayPage = () => {
</Button>
</div>
</form>
<div className="text-xs my-4 text-red-500 overflow-clip whitespace-pre-wrap">
<div className="my-4 text-clip whitespace-pre-wrap text-xs text-red-500">
{isPrepareError && (
<p>Error preparing transaction: {prepareError?.message}</p>
)}
Expand Down
2 changes: 1 addition & 1 deletion app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export default function Index({ children }: RootLayoutProps) {
<NFTProvider>
<div className="relative flex min-h-screen flex-col">
<SiteHeader />
<section className="container px-4 mt-4">{children}</section>
<section className="container mt-4 px-4">{children}</section>
</div>
<Toaster />
</NFTProvider>
Expand Down
18 changes: 9 additions & 9 deletions app/messaging/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,10 @@ const MessagingPage = () => {

return (
<div className="px-4">
<h1 className="text-2xl font-bold leading-tight tracking-tight mt-6 mb-4">
<h1 className="mb-4 mt-6 text-2xl font-bold leading-tight tracking-tight">
Cross-Chain Message
</h1>
<div className="grid grid-cols-1 sm:grid-cols-6 gap-10 items-start">
<div className="grid grid-cols-1 items-start gap-10 sm:grid-cols-6">
<div className="col-span-1 sm:col-span-2">
<Card className="p-4">
<form
Expand Down Expand Up @@ -304,8 +304,8 @@ const MessagingPage = () => {
</Card>
</div>

<div className="text-sm col-span-1 sm:col-span-3">
<div className="max-w-prose leading-6 space-y-2">
<div className="col-span-1 text-sm sm:col-span-3">
<div className="max-w-prose space-y-2 leading-6">
<p>
This is a dapp that uses ZetaChain&apos;s{" "}
<strong>cross-chain messaging</strong> for sending text messages
Expand All @@ -321,8 +321,8 @@ const MessagingPage = () => {
href="https://www.zetachain.com/docs/developers/cross-chain-messaging/examples/hello-world/"
target="_blank"
>
<Button variant="outline" className="mt-4 mb-2">
<BookOpen className="w-4 h-4 mr-2" />
<Button variant="outline" className="mb-2 mt-4">
<BookOpen className="mr-2 h-4 w-4" />
Tutorial
</Button>
</Link>
Expand All @@ -332,15 +332,15 @@ const MessagingPage = () => {
deployed on the following networks:
</p>
</div>
<pre className="my-4 rounded-md bg-slate-950 p-4 w-full overflow-x-scroll">
<pre className="my-4 w-full overflow-x-scroll rounded-md bg-slate-950 p-4">
<code className="text-white">
{JSON.stringify(contracts, null, 2)}
</code>
</pre>
<div className="max-w-prose leading-6 space-y-2">
<div className="max-w-prose space-y-2 leading-6">
<p>Let&apos;s try using the dapp:</p>
</div>{" "}
<ol className="mt-5 text-sm leading-6 space-y-4">
<ol className="mt-5 space-y-4 text-sm leading-6">
<li className="flex">
<Checkbox
className="mr-2 mt-1"
Expand Down
Loading

0 comments on commit 43f25b9

Please sign in to comment.