Skip to content

Commit adaa9d2

Browse files
committed
Applied the corrections from the review
1 parent e1dbc58 commit adaa9d2

10 files changed

Lines changed: 62 additions & 51 deletions

File tree

prisma/schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ generator client {
44

55
datasource db {
66
provider = "postgresql"
7-
url = env("DATABASE_URL")
7+
url = "postgres://test:test@localhost:5432/test"
88
}
99

1010

public/image/avatar1.png

-7.81 KB
Binary file not shown.

public/image/avatar2.png

-370 KB
Binary file not shown.

public/image/avatar3.png

-24.4 KB
Binary file not shown.

public/image/avatar4.png

-520 KB
Binary file not shown.

public/image/avatar5.png

-26.2 KB
Binary file not shown.

src/app/elections/[electionId]/results/page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1+
import { getCandidates } from "@packages/DAO/candidates.dao";
12
import ResultCard from "@packages/components/ResultCard";
2-
import candidates from "src/data/data";
33
const Home = () => {
44
return (
55
<div>
66
<div className="flex items-center justify-center h-[80vh] content-center">
77
<div>
88
<h1 className="text-center text-xl p-16">Resultado da Eleição</h1>
9-
{candidates.map(
10-
({ image, candidate, vice, party, percentagem, votos }) => (
9+
{getCandidates().map(
10+
({ image, candidate, vice, party, percentage, votes }) => (
1111
<div key={candidate} className="p-4">
1212
<ResultCard
1313
image={image}
1414
candidate={candidate}
1515
vice={vice}
1616
party={party}
17-
percentagem={percentagem}
18-
votos={votos}
17+
percentagem={percentage}
18+
votos={votes}
1919
/>
2020
</div>
2121
),

src/data/data.tsx

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/packages/DAO/candidates.dao.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
type Candidate = {
2+
image: string;
3+
candidate: string;
4+
vice: string;
5+
party: string;
6+
percentage: string;
7+
votes: string;
8+
};
9+
10+
const candidates: Candidate[] = [
11+
{
12+
image: "https://picsum.photos/id/237/200/300",
13+
candidate: "Jiji Ping Png",
14+
vice: "Xinguilingui",
15+
party: "PCC",
16+
percentage: "35.2%",
17+
votes: "3,200,000",
18+
},
19+
{
20+
image: "https://picsum.photos/id/444/200/300",
21+
candidate: "Vladimir Putin",
22+
vice: "Zelensky",
23+
party: "ABC",
24+
percentage: "28.1%",
25+
votes: "2,550,000",
26+
},
27+
{
28+
image: "https://picsum.photos/id/398/200/300",
29+
candidate: "Lulão da massa",
30+
vice: "Xuxu",
31+
party: "DEF",
32+
percentage: "18.4%",
33+
votes: "1,670,000",
34+
},
35+
{
36+
image: "https://picsum.photos/id/577/200/300",
37+
candidate: "Biden",
38+
vice: "Gagá",
39+
party: "GHI",
40+
percentage: "12.3%",
41+
votes: "1,120,000",
42+
},
43+
{
44+
image: "https://picsum.photos/id/610/200/300",
45+
candidate: "Trump",
46+
vice: "Bolsonaro",
47+
party: "JKL",
48+
percentage: "6.0%",
49+
votes: "540,000",
50+
},
51+
];
52+
53+
export function getCandidates() {
54+
return candidates;
55+
}

src/packages/components/ResultCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function ResultCard({
1818
image,
1919
}: ElectionResult) {
2020
return (
21-
<Card className="flex flex-row w-[60vw] p-4 shadow-md shadow-gray-200 border-[rgba(0,0,0,0)]">
21+
<Card className="flex flex-row w-[60vw] p-4 shadow-md shadow-gray-200">
2222
<div className="flex w-[40vw] gap-4">
2323
<Avatar className="w-16 h-16">
2424
<AvatarImage src={image} />

0 commit comments

Comments
 (0)