From 042a1a950fdd4d4a61edf4bc19657f9b7a526da8 Mon Sep 17 00:00:00 2001 From: Ryan Cohen Date: Thu, 5 Jan 2023 12:09:08 +0900 Subject: [PATCH] fix: update StatusBadgeMini to shrink on title cards (and remove ring) (#3210) --- .../Common/StatusBadgeMini/index.tsx | 32 +++++++++++++++---- src/components/TitleCard/index.tsx | 5 +-- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/components/Common/StatusBadgeMini/index.tsx b/src/components/Common/StatusBadgeMini/index.tsx index 0071126c6..a7e24a378 100644 --- a/src/components/Common/StatusBadgeMini/index.tsx +++ b/src/components/Common/StatusBadgeMini/index.tsx @@ -7,31 +7,47 @@ interface StatusBadgeMiniProps { status: MediaStatus; is4k?: boolean; inProgress?: boolean; + // Should the badge shrink on mobile to a smaller size? (TitleCard) + shrink?: boolean; } const StatusBadgeMini = ({ status, is4k = false, inProgress = false, + shrink = false, }: StatusBadgeMiniProps) => { - const badgeStyle = ['w-5 rounded-full p-0.5 ring-1 bg-opacity-80']; + const badgeStyle = [ + `rounded-full bg-opacity-80 shadow-md ${ + shrink ? 'w-4 sm:w-5 border p-0' : 'w-5 ring-1 p-0.5' + }`, + ]; + let indicatorIcon: React.ReactNode; switch (status) { case MediaStatus.PROCESSING: - badgeStyle.push('bg-indigo-500 ring-indigo-400 text-indigo-100'); + badgeStyle.push( + 'bg-indigo-500 border-indigo-400 ring-indigo-400 text-indigo-100' + ); indicatorIcon = ; break; case MediaStatus.AVAILABLE: - badgeStyle.push('bg-green-500 ring-green-400 text-green-100'); + badgeStyle.push( + 'bg-green-500 border-green-400 ring-green-400 text-green-100' + ); indicatorIcon = ; break; case MediaStatus.PENDING: - badgeStyle.push('bg-yellow-500 ring-yellow-400 text-yellow-100'); + badgeStyle.push( + 'bg-yellow-500 border-yellow-400 ring-yellow-400 text-yellow-100' + ); indicatorIcon = ; break; case MediaStatus.PARTIALLY_AVAILABLE: - badgeStyle.push('bg-green-500 ring-green-400 text-green-100'); + badgeStyle.push( + 'bg-green-500 border-green-400 ring-green-400 text-green-100' + ); indicatorIcon = ; break; } @@ -41,7 +57,11 @@ const StatusBadgeMini = ({ } return ( -
+
{indicatorIcon}
{is4k && 4K}
diff --git a/src/components/TitleCard/index.tsx b/src/components/TitleCard/index.tsx index 6f15bc0ae..be5ad5fa8 100644 --- a/src/components/TitleCard/index.tsx +++ b/src/components/TitleCard/index.tsx @@ -129,7 +129,7 @@ const TitleCard = ({ />
{currentStatus && ( -
+
)}