|
1 | 1 | import { BurgerMenu, Header, LoadingScreen } from '@/components';
|
| 2 | +import WithTooltip from '@/components/ui/with-tooltip'; |
2 | 3 | import { useSupporters } from '@/hooks';
|
| 4 | +import { Link } from 'react-router-dom'; |
3 | 5 |
|
4 | 6 | const Supporters = () => {
|
5 | 7 | const { data: supporters, loading } = useSupporters();
|
6 | 8 |
|
7 | 9 | if (loading) return <LoadingScreen />;
|
8 | 10 |
|
9 | 11 | return (
|
10 |
| - <div className="flex flex-col h-screen items-center"> |
| 12 | + <div className="flex flex-col h-screen items-center bg-gray-50 overflow-auto"> |
11 | 13 | <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 |
| - ))} |
| 14 | + <div className="flex flex-col gap-4 p-4 max-w-5xl pb-8 w-full"> |
| 15 | + <h2 className="text-4xl pt-4 font-semibold !text-zinc-900"> |
| 16 | + Apoiadores do projeto |
| 17 | + </h2> |
| 18 | + <div className="grid grid-cols-2 md:grid-cols-4 w-full gap-4 md:gap-8 mt-8"> |
| 19 | + {supporters |
| 20 | + .sort((a, b) => a.createdAt.localeCompare(b.createdAt)) |
| 21 | + .map((supporter, idx) => ( |
| 22 | + <Link key={idx} to={supporter.link}> |
| 23 | + <WithTooltip content={supporter.name}> |
| 24 | + <div className="bg-white flex flex-col gap-2 w-full aspect-square p-4 justify-between shadow-sm rounded-md hover:border-text hover:cursor-pointer"> |
| 25 | + <div |
| 26 | + style={{ |
| 27 | + backgroundImage: `url('${supporter.imageUrl}')`, |
| 28 | + }} |
| 29 | + className="flex-1 bg-center w-full bg-contain bg-no-repeat" |
| 30 | + /> |
| 31 | + </div> |
| 32 | + </WithTooltip> |
| 33 | + </Link> |
| 34 | + ))} |
27 | 35 | </div>
|
28 | 36 | </div>
|
29 | 37 | </div>
|
|
0 commit comments