-
Notifications
You must be signed in to change notification settings - Fork 15
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
ab783fe
commit bcc4cd4
Showing
10 changed files
with
362 additions
and
134 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"$schema": "https://ui.shadcn.com/schema.json", | ||
"style": "new-york", | ||
"rsc": true, | ||
"tsx": true, | ||
"tailwind": { | ||
"config": "tailwind.config.ts", | ||
"css": "src/app/globals.css", | ||
"baseColor": "neutral", | ||
"cssVariables": true, | ||
"prefix": "" | ||
}, | ||
"aliases": { | ||
"components": "@/components", | ||
"utils": "@/lib/utils", | ||
"ui": "@/components/ui", | ||
"lib": "@/lib", | ||
"hooks": "@/hooks" | ||
}, | ||
"iconLibrary": "lucide" | ||
} |
Large diffs are not rendered by default.
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
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,38 @@ | ||
import { Badge } from "./ui/badge" | ||
import { Card, CardContent, CardHeader } from "./ui/card" | ||
|
||
interface HighlightedVoteProps { | ||
question: string | ||
category: string | ||
votes?: number | ||
comments?: number | ||
} | ||
|
||
export default function HighlightedVote({ | ||
question, | ||
category, | ||
votes = 0, | ||
comments = 0 | ||
}: HighlightedVoteProps) { | ||
return ( | ||
<Card className="max-w-sm border-none bg-[#2C5154] shadow-xl rounded-3xl"> | ||
<CardHeader className="pb-2"> | ||
<h2 className="text-3xl font-medium text-white"> | ||
{question} | ||
</h2> | ||
</CardHeader> | ||
<CardContent className="space-y-12"> | ||
<Badge | ||
variant="secondary" | ||
className="bg-[#E36C59] border-none font-normal px-3 hover:bg-[#E36C59] shadow-xl text-[#EEEEEE] text-lg rounded-full" | ||
> | ||
{category} | ||
</Badge> | ||
<div className="flex gap-8 text-xl text-[#EEEEEE]"> | ||
<span>{votes} votes</span> | ||
<span>{comments} comments</span> | ||
</div> | ||
</CardContent> | ||
</Card> | ||
) | ||
} |
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,36 @@ | ||
import * as React from "react" | ||
import { cva, type VariantProps } from "class-variance-authority" | ||
|
||
import { cn } from "@/lib/utils" | ||
|
||
const badgeVariants = cva( | ||
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", | ||
{ | ||
variants: { | ||
variant: { | ||
default: | ||
"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80", | ||
secondary: | ||
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", | ||
destructive: | ||
"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80", | ||
outline: "text-foreground", | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: "default", | ||
}, | ||
} | ||
) | ||
|
||
export interface BadgeProps | ||
extends React.HTMLAttributes<HTMLDivElement>, | ||
VariantProps<typeof badgeVariants> {} | ||
|
||
function Badge({ className, variant, ...props }: BadgeProps) { | ||
return ( | ||
<div className={cn(badgeVariants({ variant }), className)} {...props} /> | ||
) | ||
} | ||
|
||
export { Badge, badgeVariants } |
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,76 @@ | ||
import * as React from "react" | ||
|
||
import { cn } from "@/lib/utils" | ||
|
||
const Card = React.forwardRef< | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
className={cn( | ||
"rounded-xl border bg-card text-card-foreground shadow", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
)) | ||
Card.displayName = "Card" | ||
|
||
const CardHeader = React.forwardRef< | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
className={cn("flex flex-col space-y-1.5 p-6", className)} | ||
{...props} | ||
/> | ||
)) | ||
CardHeader.displayName = "CardHeader" | ||
|
||
const CardTitle = React.forwardRef< | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
className={cn("font-semibold leading-none tracking-tight", className)} | ||
{...props} | ||
/> | ||
)) | ||
CardTitle.displayName = "CardTitle" | ||
|
||
const CardDescription = React.forwardRef< | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
className={cn("text-sm text-muted-foreground", className)} | ||
{...props} | ||
/> | ||
)) | ||
CardDescription.displayName = "CardDescription" | ||
|
||
const CardContent = React.forwardRef< | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} /> | ||
)) | ||
CardContent.displayName = "CardContent" | ||
|
||
const CardFooter = React.forwardRef< | ||
HTMLDivElement, | ||
React.HTMLAttributes<HTMLDivElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
className={cn("flex items-center p-6 pt-0", className)} | ||
{...props} | ||
/> | ||
)) | ||
CardFooter.displayName = "CardFooter" | ||
|
||
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } |
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,6 @@ | ||
import { clsx, type ClassValue } from "clsx" | ||
import { twMerge } from "tailwind-merge" | ||
|
||
export function cn(...inputs: ClassValue[]) { | ||
return twMerge(clsx(inputs)) | ||
} |
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,18 +1,62 @@ | ||
import type { Config } from "tailwindcss"; | ||
|
||
export default { | ||
content: [ | ||
darkMode: ["class"], | ||
content: [ | ||
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}", | ||
"./src/components/**/*.{js,ts,jsx,tsx,mdx}", | ||
"./src/app/**/*.{js,ts,jsx,tsx,mdx}", | ||
], | ||
theme: { | ||
extend: { | ||
colors: { | ||
background: "var(--background)", | ||
foreground: "var(--foreground)", | ||
}, | ||
}, | ||
extend: { | ||
colors: { | ||
background: 'hsl(var(--background))', | ||
foreground: 'hsl(var(--foreground))', | ||
card: { | ||
DEFAULT: 'hsl(var(--card))', | ||
foreground: 'hsl(var(--card-foreground))' | ||
}, | ||
popover: { | ||
DEFAULT: 'hsl(var(--popover))', | ||
foreground: 'hsl(var(--popover-foreground))' | ||
}, | ||
primary: { | ||
DEFAULT: 'hsl(var(--primary))', | ||
foreground: 'hsl(var(--primary-foreground))' | ||
}, | ||
secondary: { | ||
DEFAULT: 'hsl(var(--secondary))', | ||
foreground: 'hsl(var(--secondary-foreground))' | ||
}, | ||
muted: { | ||
DEFAULT: 'hsl(var(--muted))', | ||
foreground: 'hsl(var(--muted-foreground))' | ||
}, | ||
accent: { | ||
DEFAULT: 'hsl(var(--accent))', | ||
foreground: 'hsl(var(--accent-foreground))' | ||
}, | ||
destructive: { | ||
DEFAULT: 'hsl(var(--destructive))', | ||
foreground: 'hsl(var(--destructive-foreground))' | ||
}, | ||
border: 'hsl(var(--border))', | ||
input: 'hsl(var(--input))', | ||
ring: 'hsl(var(--ring))', | ||
chart: { | ||
'1': 'hsl(var(--chart-1))', | ||
'2': 'hsl(var(--chart-2))', | ||
'3': 'hsl(var(--chart-3))', | ||
'4': 'hsl(var(--chart-4))', | ||
'5': 'hsl(var(--chart-5))' | ||
} | ||
}, | ||
borderRadius: { | ||
lg: 'var(--radius)', | ||
md: 'calc(var(--radius) - 2px)', | ||
sm: 'calc(var(--radius) - 4px)' | ||
} | ||
} | ||
}, | ||
plugins: [], | ||
plugins: [require("tailwindcss-animate")], | ||
} satisfies Config; |