generated from CodeChefVIT/template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ea777f
commit 6cb7bee
Showing
8 changed files
with
147 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
"use client"; | ||
import { useState } from "react"; | ||
import { Crown, BadgeMinus, Files, Check } from "lucide-react"; | ||
import { Button } from "@/components/ui/button"; | ||
import { CopyToClipboard } from "react-copy-to-clipboard"; | ||
const team = { | ||
memberName: "John dobecrazy", | ||
teamName: "Team valhalla", | ||
isLeader: true, | ||
teamMembers: [ | ||
{ name: "John doe", isLeader: false }, | ||
{ name: "John doe", isLeader: false }, | ||
{ name: "John doe", isLeader: false }, | ||
], | ||
teamCode: "123456", | ||
}; | ||
|
||
function TeamCard() { | ||
const [isCopied, setIsCopied] = useState(false); | ||
const onCopyText = () => { | ||
setIsCopied(true); | ||
setTimeout(() => { | ||
setIsCopied(false); | ||
}, 1000); | ||
}; | ||
return ( | ||
<> | ||
<div> | ||
<div className="h-fit w-full rounded-xl bg-white md:w-[400px]"> | ||
<div className="pl-3 pt-2 font-semibold text-[#45464E]"> | ||
Your Devsoc Team | ||
</div> | ||
<div className="flex flex-col items-center justify-center p-8"> | ||
<p className="text-2xl font-semibold">{team.teamName}</p> | ||
<p className="pb-4 text-sm text-[#8B8D97]">Team Members</p> | ||
<div className="mb-2 flex w-full items-center justify-between rounded-lg border-2 border-[#B6B6B6] p-3"> | ||
{team.memberName} | ||
{team.isLeader && ( | ||
<span className="text-[#FFBE3D]"> | ||
<Crown /> | ||
</span> | ||
)} | ||
</div> | ||
{team.teamMembers.map((member, index) => ( | ||
<div | ||
key={index} | ||
className="mb-2 flex w-full items-center justify-between rounded-lg border-2 border-[#B6B6B6] p-3" | ||
> | ||
<span>{member.name}</span> | ||
{member.isLeader ? ( | ||
<span className="text-[#FFBE3D]"> | ||
<Crown /> | ||
</span> | ||
) : ( | ||
<span className="text-[#AD1136]"> | ||
<BadgeMinus /> | ||
</span> | ||
)} | ||
</div> | ||
))} | ||
<CopyToClipboard text={team.teamCode} onCopy={onCopyText}> | ||
<Button className="mt-4 self-center flex items-center gap-x-2"> | ||
<span className="text-white">{isCopied ? <Check size={20} /> : <Files size={20} />}</span> | ||
{team.teamCode} | ||
</Button> | ||
</CopyToClipboard> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default TeamCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters