diff --git a/src/components/BurgerMenu/BurgerMenu.tsx b/src/components/BurgerMenu/BurgerMenu.tsx index d42249a7..526a5e02 100644 --- a/src/components/BurgerMenu/BurgerMenu.tsx +++ b/src/components/BurgerMenu/BurgerMenu.tsx @@ -3,6 +3,7 @@ import { CircleHelp, CirclePlus, DoorOpen, + HeartHandshake, Info, LinkIcon, Menu, @@ -65,6 +66,11 @@ const BurgerMenu = () => { link="/politica-de-privacidade" icon={} /> + } + /> {partners.length > 0 && ( diff --git a/src/hooks/index.ts b/src/hooks/index.ts index ca1f96bd..a8007959 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -11,6 +11,7 @@ import { useViaCep } from './useViaCep'; import { usePartners } from './usePartners'; import { useGithubContributors } from './useGithubContributors'; import { useAuthRoles } from './useAuthRoles'; +import { useSupporters } from './useSupporters'; export { useShelters, @@ -26,4 +27,5 @@ export { usePartners, useGithubContributors, useAuthRoles, + useSupporters, }; diff --git a/src/hooks/useSupporters/index.ts b/src/hooks/useSupporters/index.ts new file mode 100644 index 00000000..6e7645d3 --- /dev/null +++ b/src/hooks/useSupporters/index.ts @@ -0,0 +1,3 @@ +import { useSupporters } from './useSupporters'; + +export { useSupporters }; diff --git a/src/hooks/useSupporters/types.ts b/src/hooks/useSupporters/types.ts new file mode 100644 index 00000000..9a499bb2 --- /dev/null +++ b/src/hooks/useSupporters/types.ts @@ -0,0 +1,8 @@ +export interface ISupporter { + id: string; + name: string; + imageUrl: string; + link: string; + createdAt: string; + updatedAt?: string | null; +} diff --git a/src/hooks/useSupporters/useSupporters.tsx b/src/hooks/useSupporters/useSupporters.tsx new file mode 100644 index 00000000..cc8a5ae7 --- /dev/null +++ b/src/hooks/useSupporters/useSupporters.tsx @@ -0,0 +1,11 @@ +import { useFetch } from '../useFetch'; +import { ISupporter } from './types'; + +const useSupporters = () => { + return useFetch('/supporters', { + initialValue: [], + cache: true, + }); +}; + +export { useSupporters }; diff --git a/src/pages/Supporters/Supporters.tsx b/src/pages/Supporters/Supporters.tsx new file mode 100644 index 00000000..9e01b089 --- /dev/null +++ b/src/pages/Supporters/Supporters.tsx @@ -0,0 +1,33 @@ +import { BurgerMenu, Header, LoadingScreen } from '@/components'; +import { useSupporters } from '@/hooks'; + +const Supporters = () => { + const { data: supporters, loading } = useSupporters(); + + if (loading) return ; + + return ( +
+
} /> +
+

Apoiadores do projeto

+
+ {supporters.map((supporter, idx) => ( +
+

{supporter.name}

+
+
+ ))} +
+
+
+ ); +}; + +export { Supporters }; diff --git a/src/pages/Supporters/index.ts b/src/pages/Supporters/index.ts new file mode 100644 index 00000000..02e0cdb9 --- /dev/null +++ b/src/pages/Supporters/index.ts @@ -0,0 +1,3 @@ +import { Supporters } from './Supporters'; + +export { Supporters }; diff --git a/src/pages/index.ts b/src/pages/index.ts index 89193cb6..8afdb97c 100644 --- a/src/pages/index.ts +++ b/src/pages/index.ts @@ -1,5 +1,4 @@ import { SignIn } from './SignIn'; - import { Home } from './Home'; import { Shelter } from './Shelter'; import { EditShelterSupply } from './EditShelterSupply'; @@ -8,6 +7,7 @@ import { CreateShelter } from './CreateShelter'; import { UpdateShelter } from './UpdateShelter'; import { PrivacyPolicy } from './PrivacyPolicy'; import { AboutUs } from './AboutUs'; +import { Supporters } from './Supporters'; export { SignIn, @@ -19,4 +19,5 @@ export { UpdateShelter, PrivacyPolicy, AboutUs, + Supporters, }; diff --git a/src/routes/Routes.tsx b/src/routes/Routes.tsx index ae33aac3..6dd56608 100644 --- a/src/routes/Routes.tsx +++ b/src/routes/Routes.tsx @@ -10,6 +10,7 @@ import { UpdateShelter, PrivacyPolicy, AboutUs, + Supporters, } from '@/pages'; const Routes = () => { @@ -27,6 +28,7 @@ const Routes = () => { } /> } /> } /> + } /> } /> );