Skip to content

Commit b8b2ca7

Browse files
refactor(status): rename "Sob controle" to "Não preciso"
1 parent 29a7ec1 commit b8b2ca7

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

src/lib/utils.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function cn(...inputs: ClassValue[]) {
1212
function variantStatusPriority(priority: SupplyPriority) {
1313
if (priority === SupplyPriority.Needing) return 'danger';
1414
if (priority === SupplyPriority.Urgent) return 'warn';
15-
if (priority === SupplyPriority.UnderControl) return 'alert';
15+
if (priority === SupplyPriority.NotNeeded) return 'alert';
1616
if (priority === SupplyPriority.Remaining) return 'success';
1717
}
1818

@@ -22,7 +22,7 @@ function variantStatusPriority(priority: SupplyPriority) {
2222
const colorStatusPriority = (priority: SupplyPriority) => {
2323
if (priority === SupplyPriority.Needing) return 'bg-[#f69f9d]';
2424
if (priority === SupplyPriority.Urgent) return 'bg-[#f8b993]';
25-
if (priority === SupplyPriority.UnderControl) return 'bg-[#f9cf8d]';
25+
if (priority === SupplyPriority.NotNeeded) return 'bg-[#f9cf8d]';
2626
if (priority === SupplyPriority.Remaining) return 'bg-[#63bc43]';
2727
};
2828

@@ -32,7 +32,7 @@ const colorStatusPriority = (priority: SupplyPriority) => {
3232
function nameStatusPriority(priority: SupplyPriority) {
3333
if (priority === SupplyPriority.Needing) return 'Precisa urgentimente';
3434
if (priority === SupplyPriority.Urgent) return 'Precisa';
35-
if (priority === SupplyPriority.UnderControl) return 'Sob-controle';
35+
if (priority === SupplyPriority.NotNeeded) return 'Não preciso';
3636
if (priority === SupplyPriority.Remaining) return 'Disponível para doação';
3737
}
3838

@@ -60,10 +60,10 @@ function getAvailabilityProps(
6060

6161
function getSupplyPriorityProps(priority: SupplyPriority) {
6262
switch (priority) {
63-
case SupplyPriority.UnderControl:
63+
case SupplyPriority.NotNeeded:
6464
return {
65-
label: 'Sob controle',
66-
className: 'bg-light-yellow',
65+
label: 'Não preciso',
66+
className: 'bg-gray-200',
6767
};
6868
case SupplyPriority.Remaining:
6969
return {

src/pages/CreateSupply/CreateSupply.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const CreateSupply = () => {
3737
name: '',
3838
supplyCategoryId: supplyCategories?.at(0)?.id ?? '-1',
3939
shelterId,
40-
priority: SupplyPriority.UnderControl,
40+
priority: SupplyPriority.NotNeeded,
4141
},
4242
enableReinitialize: true,
4343
validateOnBlur: false,
@@ -151,7 +151,7 @@ const CreateSupply = () => {
151151
SupplyPriority.Urgent,
152152
SupplyPriority.Needing,
153153
SupplyPriority.Remaining,
154-
SupplyPriority.UnderControl,
154+
SupplyPriority.NotNeeded,
155155
].map((priority) => {
156156
const { className, label } =
157157
getSupplyPriorityProps(priority);

src/pages/EditShelterSupply/EditShelterSupply.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const EditShelterSupply = () => {
5959
console.log('Item: ', item);
6060
setModalOpened(true);
6161
setModalData({
62-
value: `${item.priority ?? SupplyPriority.UnderControl}`,
62+
value: `${item.priority ?? SupplyPriority.NotNeeded}`,
6363
onSave: (v) => {
6464
const isNewSupply = item.priority === undefined;
6565
setLoadingSave(true);
@@ -125,14 +125,14 @@ const EditShelterSupply = () => {
125125
label: 'Precisa',
126126
value: `${SupplyPriority.Needing}`,
127127
},
128-
{
129-
label: 'Sob controle',
130-
value: `${SupplyPriority.UnderControl}`,
131-
},
132128
{
133129
label: 'Disponível para doação',
134130
value: `${SupplyPriority.Remaining}`,
135131
},
132+
{
133+
label: 'Remover item',
134+
value: `${SupplyPriority.NotNeeded}`,
135+
},
136136
]}
137137
isSubmitting={loadingSave}
138138
{...modalData}

src/pages/EditShelterSupply/components/SupplyRow/SupplyRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const SupplyRow = (props: ISupplyRowProps) => {
1313
<SupplyRowInfo
1414
key={idy}
1515
name={item.name}
16-
priority={item.priority ?? SupplyPriority.UnderControl}
16+
priority={item.priority ?? SupplyPriority.NotNeeded}
1717
onClick={() => (onClick ? onClick(item) : undefined)}
1818
/>
1919
))}

src/pages/Shelter/Shelter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const Shelter = () => {
2020

2121
const shelterCategories: IShelterCategoryItemsProps[] = useMemo(() => {
2222
const grouped = group(shelters?.shelterSupplies ?? [], 'priority');
23-
delete grouped[SupplyPriority.UnderControl];
23+
delete grouped[SupplyPriority.NotNeeded];
2424
return Object.entries(grouped)
2525
.sort(([a], [b]) => (+a > +b ? -1 : 1))
2626
.map(([key, values]) => ({

src/pages/Shelter/components/ShelterCategoryItems/ShelterCategoryItems.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Button } from '@/components/ui/button';
88
import { SupplyPriority } from '@/service/supply/types';
99

1010
const ShelterCategoryItems = (props: IShelterCategoryItemsProps) => {
11-
const { priority = SupplyPriority.UnderControl, tags } = props;
11+
const { priority = SupplyPriority.NotNeeded, tags } = props;
1212
const [opened, setOpened] = useState<boolean>(false);
1313
const maxVisibleTags: number = 10;
1414
const visibleTags = useMemo(

src/service/supply/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export enum SupplyPriority {
2-
UnderControl = 0,
2+
NotNeeded = 0,
33
Remaining = 1,
44
Needing = 10,
55
Urgent = 100,

0 commit comments

Comments
 (0)