|
| 1 | +import { useState } from "react"; |
| 2 | +import Banner from "../dashboard-components/Banner"; |
| 3 | +import BannerCampaign from "../dashboard-components/BannerCampaign"; |
| 4 | + |
| 5 | +const CampaignDetails = () => { |
| 6 | + return ( |
| 7 | + <div className="px-18 py-16 flex flex-col space-y-4"> |
| 8 | + <BannerCampaign |
| 9 | + title="Early NFT Collector" |
| 10 | + icon={"/coiton-logo.png"} |
| 11 | + owner="Coiton" |
| 12 | + shareLink="/" |
| 13 | + telegramLink="/" |
| 14 | + xLink="/" |
| 15 | + /> |
| 16 | + <Banner date="20th May, 5:20pm" /> |
| 17 | + <div> |
| 18 | + <p className="text-[22px]"> |
| 19 | + This campaign rewards early adopters who mint and hold a |
| 20 | + genesis or limited edition NFT. It will be used to give |
| 21 | + early community members special access later. |
| 22 | + </p> |
| 23 | + <p className="mt-3 text-[22px]"> |
| 24 | + <span className="font-bold">Goal: </span> Distribute limited |
| 25 | + NFTs and build early collector hype. |
| 26 | + </p> |
| 27 | + </div> |
| 28 | + <TasksSection /> |
| 29 | + </div> |
| 30 | + ); |
| 31 | +}; |
| 32 | + |
| 33 | +const tasksObj = [ |
| 34 | + { |
| 35 | + title: "Mint the Genesis NFT from a drop page.", |
| 36 | + details: [ |
| 37 | + "Visit the drop page URL", |
| 38 | + "Connect your crypto wallet (e.g., MetaMask)", |
| 39 | + 'Click the "Mint" button', |
| 40 | + "Approve the transaction in your wallet", |
| 41 | + ], |
| 42 | + }, |
| 43 | + { |
| 44 | + title: "Hold it in your wallet for at least 7 days (verified via snapshot or chain data)", |
| 45 | + details: null, |
| 46 | + }, |
| 47 | + { |
| 48 | + title: "Share your NFT on Twitter (bonus task)", |
| 49 | + details: null, |
| 50 | + }, |
| 51 | +]; |
| 52 | + |
| 53 | +const TasksSection = () => { |
| 54 | + const [openIndex, setOpenIndex] = useState(0); |
| 55 | + |
| 56 | + return ( |
| 57 | + <div className="bg-black p-4 rounded-lg w-full "> |
| 58 | + <h2 className="text-white text-lg font-medium mb-2">Tasks</h2> |
| 59 | + <div className="space-y-2"> |
| 60 | + {tasksObj.map((task, idx) => ( |
| 61 | + <div key={idx}> |
| 62 | + <button |
| 63 | + className={`w-full flex items-center space-x-5 px-4 py-2 rounded transition-colors focus:outline-none border ${ |
| 64 | + openIndex === idx |
| 65 | + ? "bg-[#E0FFB0] border-blue-400" |
| 66 | + : "bg-[#E0FFB0] border-transparent" |
| 67 | + }`} |
| 68 | + onClick={() => |
| 69 | + setOpenIndex(idx === openIndex ? -1 : idx) |
| 70 | + } |
| 71 | + > |
| 72 | + <span className="ml-2 text-2xl text-black"> |
| 73 | + {openIndex === idx ? "▾" : "▸"} |
| 74 | + </span> |
| 75 | + <span className="text-black">{task.title}</span> |
| 76 | + </button> |
| 77 | + {openIndex === idx && task.details && ( |
| 78 | + <div className="bg-black border border-[#988C8C] rounded px-12 py-4 my-5 mx-8"> |
| 79 | + <ol className="list-decimal list-inside text-[#EBFFCB] text-[22px] space-y-3"> |
| 80 | + {task.details.map((step, i) => ( |
| 81 | + <li key={i}> |
| 82 | + {step.includes('"Mint"') ? ( |
| 83 | + <span> |
| 84 | + Click the{" "} |
| 85 | + <span className="font-semibold"> |
| 86 | + "Mint" |
| 87 | + </span>{" "} |
| 88 | + button |
| 89 | + </span> |
| 90 | + ) : ( |
| 91 | + step |
| 92 | + )} |
| 93 | + </li> |
| 94 | + ))} |
| 95 | + </ol> |
| 96 | + </div> |
| 97 | + )} |
| 98 | + </div> |
| 99 | + ))} |
| 100 | + </div> |
| 101 | + </div> |
| 102 | + ); |
| 103 | +}; |
| 104 | + |
| 105 | +export default CampaignDetails; |
0 commit comments