-
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.
Applied the corrections from the review
- Loading branch information
Showing
11 changed files
with
85 additions
and
93 deletions.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 was deleted.
Oops, something went wrong.
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,52 @@ | ||
type Candidate = { | ||
image: string; | ||
candidate: string; | ||
vice: string; | ||
party: string; | ||
percentage: string; | ||
votes: string; | ||
}; | ||
|
||
const candidates: Candidate[] = [ | ||
{ | ||
image: "https://picsum.photos/id/237/200/300", | ||
candidate: "Jiji Ping Png", | ||
vice: "Xinguilingui", | ||
party: "PCC", | ||
percentage: "35.2%", | ||
votes: "3,200,000", | ||
}, | ||
{ | ||
image: "https://picsum.photos/id/444/200/300", | ||
candidate: "Vladimir Putin", | ||
vice: "Zelensky", | ||
party: "ABC", | ||
percentage: "28.1%", | ||
votes: "2,550,000", | ||
}, | ||
{ | ||
image: "https://picsum.photos/id/398/200/300", | ||
candidate: "Lulão da massa", | ||
vice: "Xuxu", | ||
party: "DEF", | ||
percentage: "18.4%", | ||
votes: "1,670,000", | ||
}, | ||
{ | ||
image: "https://picsum.photos/id/577/200/300", | ||
candidate: "Biden", | ||
vice: "Gagá", | ||
party: "GHI", | ||
percentage: "12.3%", | ||
votes: "1,120,000", | ||
}, | ||
{ | ||
image: "https://picsum.photos/id/610/200/300", | ||
candidate: "Trump", | ||
vice: "Bolsonaro", | ||
party: "JKL", | ||
percentage: "6.0%", | ||
votes: "540,000", | ||
}, | ||
]; | ||
export default candidates; |
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 |
---|---|---|
@@ -1,50 +1,34 @@ | ||
"use client"; | ||
|
||
import * as AvatarPrimitive from "@radix-ui/react-avatar"; | ||
import * as React from "react"; | ||
|
||
import { cn } from "@packages/utils/shadcn-utils"; | ||
|
||
const Avatar = React.forwardRef< | ||
React.ElementRef<typeof AvatarPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> | ||
>(({ className, ...props }, ref) => ( | ||
<AvatarPrimitive.Root | ||
ref={ref} | ||
className={cn( | ||
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", | ||
className, | ||
)} | ||
{...props} | ||
/> | ||
)); | ||
Avatar.displayName = AvatarPrimitive.Root.displayName; | ||
|
||
const AvatarImage = React.forwardRef< | ||
React.ElementRef<typeof AvatarPrimitive.Image>, | ||
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image> | ||
>(({ className, ...props }, ref) => ( | ||
<AvatarPrimitive.Image | ||
ref={ref} | ||
className={cn("aspect-square h-full w-full", className)} | ||
{...props} | ||
/> | ||
)); | ||
AvatarImage.displayName = AvatarPrimitive.Image.displayName; | ||
|
||
const AvatarFallback = React.forwardRef< | ||
React.ElementRef<typeof AvatarPrimitive.Fallback>, | ||
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback> | ||
>(({ className, ...props }, ref) => ( | ||
<AvatarPrimitive.Fallback | ||
ref={ref} | ||
className={cn( | ||
"flex h-full w-full items-center justify-center rounded-full bg-muted", | ||
className, | ||
)} | ||
{...props} | ||
/> | ||
)); | ||
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName; | ||
const WithStyles = (ShadcnElement: React.ElementType, styles: string) => { | ||
const CustomComponent = React.forwardRef< | ||
React.ElementRef<typeof ShadcnElement>, | ||
React.ComponentPropsWithoutRef<typeof ShadcnElement> | ||
>(({ className, ...props }, ref) => ( | ||
<ShadcnElement ref={ref} className={cn(styles, className)} {...props} /> | ||
)); | ||
|
||
CustomComponent.displayName = ShadcnElement.displayName; | ||
|
||
return CustomComponent; | ||
}; | ||
|
||
const AvatarFallback = WithStyles( | ||
AvatarPrimitive.Fallback, | ||
"flex h-full w-full items-center justify-center rounded-full bg-muted", | ||
); | ||
|
||
const Avatar = WithStyles( | ||
AvatarPrimitive.Root, | ||
"flex h-full w-full items-center justify-center rounded-full bg-muted", | ||
); | ||
|
||
const AvatarImage = WithStyles( | ||
AvatarPrimitive.Image, | ||
"flex h-full w-full items-center justify-center rounded-full bg-muted", | ||
); | ||
|
||
export { Avatar, AvatarImage, AvatarFallback }; |