From 036a5819c9d7847e40cf7671edd634aad2af00f0 Mon Sep 17 00:00:00 2001 From: Hunter Chang <716376+ChangoMan@users.noreply.github.com> Date: Fri, 23 Aug 2024 11:37:45 +0800 Subject: [PATCH 1/3] use grid for admin view. adjust card layout --- .../app/admin/_components/SubmissionCard.tsx | 178 +++++++++++------- .../app/admin/_components/Submissions.tsx | 6 +- packages/nextjs/public/logo-telegram.svg | 1 + 3 files changed, 111 insertions(+), 74 deletions(-) create mode 100644 packages/nextjs/public/logo-telegram.svg diff --git a/packages/nextjs/app/admin/_components/SubmissionCard.tsx b/packages/nextjs/app/admin/_components/SubmissionCard.tsx index eaca930..ee99ccd 100644 --- a/packages/nextjs/app/admin/_components/SubmissionCard.tsx +++ b/packages/nextjs/app/admin/_components/SubmissionCard.tsx @@ -87,89 +87,125 @@ export const SubmissionCard = ({ submission }: { submission: Submission }) => { const currentVote = submission.votes.find(vote => vote.builder === connectedAddress); const score = currentVote ? currentVote.score : 0; + const telegramUser = submission.telegram?.replace("@", ""); + return ( -
-
-
{scoreAvg}
-
{submission.votes.length} votes
-
-
-
-
-
+
+
+

{submission.title}

+
+
+ {submission.linkToRepository && ( + + + + + + + )} + + + + + + + + + {submission.telegram && ( + + telegram logo + + )} +
+ {submission.builder &&
} +
+ +

{submission.description}

+ {submission.feedback &&

Extensions feedback: {submission.feedback}

} + +
+
+ vote(0)} + /> + {[...Array(10)].map((_e, i) => ( vote(0)} + className="mask mask-star" + title={(i + 1).toString()} + checked={score === i + 1} + key={i} + onChange={() => vote(i + 1)} /> - {[...Array(10)].map((_e, i) => ( - vote(i + 1)} - /> - ))} - {score > 0 && ( - - )} -
+ ))} + {score > 0 && ( + + )}
-

{submission.title}

- {submission.linkToRepository && ( - - {submission.linkToRepository} - - )} -

{submission.description}

-

- Video: - - {submission.linkToVideo} - -

- {submission.builder &&
} - {submission.telegram &&

Telegram: {submission.telegram}

} - {submission.feedback &&

Extensions feedback: {submission.feedback}

} -
- -
{submission.comments.length} comments
-
- {submission.comments?.map(comment => ( -
-
-
-

{comment.comment}

-

{comment.createdAt ? getFormattedDateTime(new Date(comment.createdAt)) : "-"}

-
-
- ))} -
+
+ +
+ +
{submission.comments.length} comments
+
+ {submission.comments?.map(comment => ( +
-
-