Skip to content

Commit

Permalink
finish contribution card with mock data
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan-Y-Ko committed Sep 5, 2023
1 parent 9e6954a commit bc09855
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
30 changes: 21 additions & 9 deletions src/app/ideation/components/ContributionCard.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
import { Avatar, Button } from "@/components";

function ContributionCard() {
interface ContributionCardProps {
own_idea: boolean;
contributed_by: {
name: string;
avatar?: string;
};
}

function ContributionCard({ own_idea, contributed_by }: ContributionCardProps) {
return (
<div className="card w-1/3 h-fit bg-accent-focus rounded-lg">
<section className="flex flex-col items-start p-4 gap-y-4">
<h1 className="text-base font-medium text-neutral-focus">
Contributed By
</h1>
<Avatar width={64} height={64} />
<h2 className="text-xl font-semibold text-neutral-focus">Test User</h2>
<Button
title="Vote"
customClassName="w-full bg-base-content text-neutral-focus border-primary"
>
Vote
</Button>
<Avatar width={64} height={64} image={contributed_by.avatar} />
<h2 className="text-xl font-semibold text-neutral-focus">
{contributed_by.name}
</h2>
{own_idea ? (
<Button
title="Vote"
customClassName="w-full bg-base-content text-neutral-focus border-primary"
>
Edit Project
</Button>
) : null}
</section>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/ideation/components/IdeationContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function IdeationContainer({
{vision_statement}
</p>
</section>
<ContributionCard />
<ContributionCard own_idea={own_idea} contributed_by={contributed_by} />
</div>
);
}
Expand Down
6 changes: 5 additions & 1 deletion src/app/ideation/components/VoteCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ function VoteCard({ users, voted }: VoteCardProps) {
<Avatar width={24} height={24} key={user} />
))}
</div>
<Button title="Vote" customClassName="w-full bg-primary hover:bg-primary-focus disabled:bg-primary-focus disabled:text-base-content" disabled={voted}>
<Button
title="Vote"
customClassName="w-full bg-primary hover:bg-primary-focus disabled:bg-primary-focus disabled:text-base-content"
disabled={voted}
>
{voted ? "Voted" : "Vote"}
</Button>
</section>
Expand Down

0 comments on commit bc09855

Please sign in to comment.