From af84463e98535e4fa357e50ffc438e62e15be59f Mon Sep 17 00:00:00 2001 From: smallfu6 Date: Sat, 11 Jan 2025 18:13:04 +0800 Subject: [PATCH] feat: reusable StatusBadge component --- src/app/bounties/Card.js | 44 ++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/src/app/bounties/Card.js b/src/app/bounties/Card.js index f08ba14..fb17b97 100644 --- a/src/app/bounties/Card.js +++ b/src/app/bounties/Card.js @@ -22,6 +22,19 @@ import Avatar from '@/components/Avatar' import { useConfig } from '#/state/application/hooks' import { fromNow } from '@/utils/date' +const StatusBadge = ({ icon, color, text, borderColor, textColor }) => { + return ( +
+ + {icon} + + + {text} + +
+ ); +}; + export function BountiesCard({ data }) { const config = useConfig() const filters = config?.find(f => f.config_id === 1)?.config_value['bounty'] @@ -30,9 +43,7 @@ export function BountiesCard({ data }) { href={`/bounties/${data.id}`} className={` group flex flex-col relative cursor-pointer overflow-hidden rounded-2xl - bg-gradient-to-b ${ - data.status === 3 ? "from-[#E5E5FE] to-[#FFFFFF]" : "bg-white" - } + bg-gradient-to-b ${ data.status === 3 ? 'from-[#E5E5FE] to-[#FFFFFF]' : 'bg-white'} py-4 transition-all duration-300 ease-in-out hover:shadow-lg hover:-translate-y-2 [&>div]:px-4 `} > @@ -68,34 +79,13 @@ export function BountiesCard({ data }) {
{data.status === 3 && ( -
- - 🧱 - - - Recruiting - -
+ )} {data.status > 6 && data.status < 24 && ( -
- - 🔫 - - - Building - -
+ )} {data.status === 30 && ( -
- - 🔚 - - - Completed - -
+ )}