Skip to content

Commit d3487ea

Browse files
fagundesjgmarcodmc
authored andcommitted
feat: done supporters page
1 parent 70f0378 commit d3487ea

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

src/pages/Supporters/Supporters.tsx

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
11
import { BurgerMenu, Header, LoadingScreen } from '@/components';
2+
import WithTooltip from '@/components/ui/with-tooltip';
23
import { useSupporters } from '@/hooks';
4+
import { Link } from 'react-router-dom';
35

46
const Supporters = () => {
57
const { data: supporters, loading } = useSupporters();
68

79
if (loading) return <LoadingScreen />;
810

911
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">
1113
<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+
))}
2735
</div>
2836
</div>
2937
</div>

0 commit comments

Comments
 (0)