Skip to content

Commit

Permalink
Merge pull request #6 from SOS-RS/fix/fix-change-text
Browse files Browse the repository at this point in the history
change text and increase  items displayed
  • Loading branch information
fagundesjg authored May 7, 2024
2 parents 20757b6 + 080e8b2 commit d984663
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function getAvailabilityProps(
capacity?: number | null,
shelteredPeople?: number | null
) {
if (capacity && shelteredPeople) {
if (capacity && (shelteredPeople || shelteredPeople === 0)) {
if (shelteredPeople < capacity)
return {
availability: 'Abrigo disponível',
Expand Down Expand Up @@ -72,12 +72,12 @@ function getSupplyPriorityProps(priority: SupplyPriority) {
};
case SupplyPriority.Needing:
return {
label: 'Urgente',
label: 'Precisa',
className: 'bg-light-orange',
};
case SupplyPriority.Urgent:
return {
label: 'Necessita Urgentemente',
label: 'Precisa Urgentemente',
className: 'bg-light-red',
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useShelters, useThrottle } from '@/hooks';
import { Button } from '@/components/ui/button';

const alertDescription =
'Você pode consultar a lista de abrigos disponíveis e os itens que necessitam de doações.';
'Você pode consultar a lista de abrigos disponíveis. Ver e editar os itens que necessitam de doações.';

const Home = () => {
const { data: shelters, loading, refresh } = useShelters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { Button } from '@/components/ui/button';
const ShelterCategoryItems = (props: IShelterCategoryItemsProps) => {
const { priority, tags } = props;
const [opened, setOpened] = useState<boolean>(false);
const maxVisibleTags: number = 7;
const maxVisibleTags: number = 10;
const visibleTags = useMemo(
() => (opened ? tags : tags.slice(0, 7)),
() => (opened ? tags : tags.slice(0, maxVisibleTags)),
[opened, tags]
);
const { className: circleClassName, label } = useMemo(
Expand Down

0 comments on commit d984663

Please sign in to comment.