File tree Expand file tree Collapse file tree 9 files changed +70
-1
lines changed Expand file tree Collapse file tree 9 files changed +70
-1
lines changed Original file line number Diff line number Diff line change 3
3
CircleHelp ,
4
4
CirclePlus ,
5
5
DoorOpen ,
6
+ HeartHandshake ,
6
7
Info ,
7
8
LinkIcon ,
8
9
Menu ,
@@ -65,6 +66,11 @@ const BurgerMenu = () => {
65
66
link = "/politica-de-privacidade"
66
67
icon = { < Info className = "w-4 h-4" /> }
67
68
/>
69
+ < BurguerMenuItem
70
+ label = "Apoiadores"
71
+ link = "/apoiadores"
72
+ icon = { < HeartHandshake className = "w-4 h-4" /> }
73
+ />
68
74
< Separator />
69
75
{ partners . length > 0 && (
70
76
< Fragment >
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { useViaCep } from './useViaCep';
11
11
import { usePartners } from './usePartners' ;
12
12
import { useGithubContributors } from './useGithubContributors' ;
13
13
import { useAuthRoles } from './useAuthRoles' ;
14
+ import { useSupporters } from './useSupporters' ;
14
15
15
16
export {
16
17
useShelters ,
@@ -26,4 +27,5 @@ export {
26
27
usePartners ,
27
28
useGithubContributors ,
28
29
useAuthRoles ,
30
+ useSupporters ,
29
31
} ;
Original file line number Diff line number Diff line change
1
+ import { useSupporters } from './useSupporters' ;
2
+
3
+ export { useSupporters } ;
Original file line number Diff line number Diff line change
1
+ export interface ISupporter {
2
+ id : string ;
3
+ name : string ;
4
+ imageUrl : string ;
5
+ link : string ;
6
+ createdAt : string ;
7
+ updatedAt ?: string | null ;
8
+ }
Original file line number Diff line number Diff line change
1
+ import { useFetch } from '../useFetch' ;
2
+ import { ISupporter } from './types' ;
3
+
4
+ const useSupporters = ( ) => {
5
+ return useFetch < ISupporter [ ] > ( '/supporters' , {
6
+ initialValue : [ ] ,
7
+ cache : true ,
8
+ } ) ;
9
+ } ;
10
+
11
+ export { useSupporters } ;
Original file line number Diff line number Diff line change
1
+ import { BurgerMenu , Header , LoadingScreen } from '@/components' ;
2
+ import { useSupporters } from '@/hooks' ;
3
+
4
+ const Supporters = ( ) => {
5
+ const { data : supporters , loading } = useSupporters ( ) ;
6
+
7
+ if ( loading ) return < LoadingScreen /> ;
8
+
9
+ return (
10
+ < div className = "flex flex-col h-screen items-center" >
11
+ < Header title = "SOS Rio Grande do Sul" startAdornment = { < BurgerMenu /> } />
12
+ < div className = "flex flex-col gap-4 p-4 max-w-4xl pb-8 w-full" >
13
+ < h3 className = "text-4xl font-semibold" > Apoiadores do projeto</ h3 >
14
+ < div className = "flex flex-wrap" >
15
+ { supporters . map ( ( supporter , idx ) => (
16
+ < div
17
+ key = { idx }
18
+ className = "flex flex-col justify-between p-4 w-full max-w-[30%] max-h-64 aspect-square border-2 border-border rounded-md hover:bg-zinc-200"
19
+ >
20
+ < h3 className = "font-medium" > { supporter . name } </ h3 >
21
+ < div
22
+ style = { { backgroundImage : `url('${ supporter . imageUrl } ')` } }
23
+ className = "bg-center h-full w-full bg-contain bg-no-repeat"
24
+ />
25
+ </ div >
26
+ ) ) }
27
+ </ div >
28
+ </ div >
29
+ </ div >
30
+ ) ;
31
+ } ;
32
+
33
+ export { Supporters } ;
Original file line number Diff line number Diff line change
1
+ import { Supporters } from './Supporters' ;
2
+
3
+ export { Supporters } ;
Original file line number Diff line number Diff line change 1
1
import { SignIn } from './SignIn' ;
2
-
3
2
import { Home } from './Home' ;
4
3
import { Shelter } from './Shelter' ;
5
4
import { EditShelterSupply } from './EditShelterSupply' ;
@@ -8,6 +7,7 @@ import { CreateShelter } from './CreateShelter';
8
7
import { UpdateShelter } from './UpdateShelter' ;
9
8
import { PrivacyPolicy } from './PrivacyPolicy' ;
10
9
import { AboutUs } from './AboutUs' ;
10
+ import { Supporters } from './Supporters' ;
11
11
12
12
export {
13
13
SignIn ,
@@ -19,4 +19,5 @@ export {
19
19
UpdateShelter ,
20
20
PrivacyPolicy ,
21
21
AboutUs ,
22
+ Supporters ,
22
23
} ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
10
10
UpdateShelter ,
11
11
PrivacyPolicy ,
12
12
AboutUs ,
13
+ Supporters ,
13
14
} from '@/pages' ;
14
15
15
16
const Routes = ( ) => {
@@ -27,6 +28,7 @@ const Routes = () => {
27
28
< Route path = "/entrar" element = { < SignIn /> } />
28
29
< Route path = "/politica-de-privacidade" element = { < PrivacyPolicy /> } />
29
30
< Route path = "/sobre-nos" element = { < AboutUs /> } />
31
+ < Route path = "/apoiadores" element = { < Supporters /> } />
30
32
< Route path = "*" element = { < Navigate to = "/" /> } />
31
33
</ Switch >
32
34
) ;
You can’t perform that action at this time.
0 commit comments