forked from SOS-RS/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7398c9e
commit b7f7dc3
Showing
9 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { useSupporters } from './useSupporters'; | ||
|
||
export { useSupporters }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export interface ISupporter { | ||
id: string; | ||
name: string; | ||
imageUrl: string; | ||
link: string; | ||
createdAt: string; | ||
updatedAt?: string | null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { useFetch } from '../useFetch'; | ||
import { ISupporter } from './types'; | ||
|
||
const useSupporters = () => { | ||
return useFetch<ISupporter[]>('/supporters', { | ||
initialValue: [], | ||
cache: true, | ||
}); | ||
}; | ||
|
||
export { useSupporters }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { BurgerMenu, Header, LoadingScreen } from '@/components'; | ||
import { useSupporters } from '@/hooks'; | ||
|
||
const Supporters = () => { | ||
const { data: supporters, loading } = useSupporters(); | ||
|
||
if (loading) return <LoadingScreen />; | ||
|
||
return ( | ||
<div className="flex flex-col h-screen items-center"> | ||
<Header title="SOS Rio Grande do Sul" startAdornment={<BurgerMenu />} /> | ||
<div className="flex flex-col gap-4 p-4 max-w-4xl pb-8 w-full"> | ||
<h3 className="text-4xl font-semibold">Apoiadores do projeto</h3> | ||
<div className="flex flex-wrap"> | ||
{supporters.map((supporter, idx) => ( | ||
<div | ||
key={idx} | ||
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" | ||
> | ||
<h3 className="font-medium">{supporter.name}</h3> | ||
<div | ||
style={{ backgroundImage: `url('${supporter.imageUrl}')` }} | ||
className="bg-center h-full w-full bg-contain bg-no-repeat" | ||
/> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export { Supporters }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Supporters } from './Supporters'; | ||
|
||
export { Supporters }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters