From fbabbf31186c9a55eb04cc0af921241b8942fae6 Mon Sep 17 00:00:00 2001
From: Lucas Silva
Date: Sat, 18 May 2024 16:45:00 -0300
Subject: [PATCH 1/4] Update - Melhoria na listagem de suplementos
---
.../ShelterSupplyCategoryRow.tsx | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx b/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx
index a711f3f0..2ad453ac 100644
--- a/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx
+++ b/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx
@@ -21,9 +21,16 @@ const ShelterSupplyCategoryRow = React.forwardRef<
{description && {description}
}
- {tags.map((s, idx) => (
+ {tags.slice(0, 10).map((s, idx) => (
))}
+
+ {tags.length > 10 && (
+
+ )}
);
From 08bc0be7c93ab2d3374e44c4f52cc19d2ed73749 Mon Sep 17 00:00:00 2001
From: Lucas Silva
Date: Tue, 21 May 2024 18:07:16 -0300
Subject: [PATCH 2/4] =?UTF-8?q?Update=20-=20corre=C3=A7=C3=A3o=20texto=20e?=
=?UTF-8?q?=20adi=C3=A7=C3=A3o=20de=20variant=20'moreInfo'=20no=20Chip=20c?=
=?UTF-8?q?omponent?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Chip/Chip.tsx | 37 ++++++++++++-------
src/components/Chip/types.ts | 2 +-
.../ShelterSupplyCategoryRow.tsx | 5 +--
3 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/src/components/Chip/Chip.tsx b/src/components/Chip/Chip.tsx
index 6440a5c3..af3e3777 100644
--- a/src/components/Chip/Chip.tsx
+++ b/src/components/Chip/Chip.tsx
@@ -5,23 +5,32 @@ import { cva } from 'class-variance-authority';
const Chip = React.forwardRef((props, ref) => {
const { label, className, variant = 'info', ...rest } = props;
- const variants = cva('px-4 py-1.5 font-medium text-sm md:text-md rounded-2xl', {
- variants: {
- variant: {
- warn: 'bg-light-yellow',
- success: 'bg-light-green',
- danger: 'bg-light-red',
- alert: 'bg-light-orange',
- info: 'bg-light-blue',
+ const variants = cva(
+ 'px-4 py-1.5 font-medium text-sm md:text-md rounded-2xl',
+ {
+ variants: {
+ variant: {
+ warn: 'bg-light-yellow',
+ success: 'bg-light-green',
+ danger: 'bg-light-red',
+ alert: 'bg-light-orange',
+ info: 'bg-light-blue',
+ moreInfo: 'bg-gray-200 text-black-600',
+ },
},
- },
- defaultVariants: {
- variant: 'info',
- },
- });
+ defaultVariants: {
+ variant: 'info',
+ },
+ }
+ );
return (
-
+
{label}
);
diff --git a/src/components/Chip/types.ts b/src/components/Chip/types.ts
index 22bfb972..f660a809 100644
--- a/src/components/Chip/types.ts
+++ b/src/components/Chip/types.ts
@@ -1,4 +1,4 @@
-export type ChipVariant = 'info' | 'success' | 'warn' | 'danger';
+export type ChipVariant = 'info' | 'success' | 'warn' | 'danger' | 'moreInfo';
export interface IChipProps extends React.ComponentPropsWithoutRef<'div'> {
label: string;
diff --git a/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx b/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx
index 2ad453ac..2b7ca11a 100644
--- a/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx
+++ b/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx
@@ -26,10 +26,7 @@ const ShelterSupplyCategoryRow = React.forwardRef<
))}
{tags.length > 10 && (
-
+
)}
From 078c1ba869766250ff7ef685234bf69087fa1c4e Mon Sep 17 00:00:00 2001
From: Lucas Silva
Date: Wed, 22 May 2024 21:33:29 -0300
Subject: [PATCH 3/4] =?UTF-8?q?Fix=20-=20corre=C3=A7=C3=A3o=20de=20formata?=
=?UTF-8?q?=C3=A7=C3=A3o=20do=20Chip=20extra=20caso=20tenha=20somete=20um?=
=?UTF-8?q?=20item?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx b/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx
index 2b7ca11a..e6013b9c 100644
--- a/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx
+++ b/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx
@@ -13,6 +13,10 @@ const ShelterSupplyCategoryRow = React.forwardRef<
if (tags.length === 0) return ;
+ const moreInfoLabel = () => {
+ return `${tags.length - 10} ${tags.length > 11 ? 'itens' : 'item'}`;
+ };
+
return (
@@ -26,7 +30,7 @@ const ShelterSupplyCategoryRow = React.forwardRef<
))}
{tags.length > 10 && (
-
+
)}
From cce9e938eda3e695b00a673259d5c166c5858baa Mon Sep 17 00:00:00 2001
From: Lucas Silva
Date: Thu, 23 May 2024 08:28:37 -0300
Subject: [PATCH 4/4] Fix - adicionando '+' na label do Chip
---
.../ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx b/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx
index e6013b9c..f8f3aa79 100644
--- a/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx
+++ b/src/pages/Home/components/ShelterSupplyCategoryRow/ShelterSupplyCategoryRow.tsx
@@ -14,7 +14,7 @@ const ShelterSupplyCategoryRow = React.forwardRef<
if (tags.length === 0) return ;
const moreInfoLabel = () => {
- return `${tags.length - 10} ${tags.length > 11 ? 'itens' : 'item'}`;
+ return `+${tags.length - 10} ${tags.length > 11 ? 'itens' : 'item'}`;
};
return (