Skip to content

Commit e2d68ba

Browse files
authored
Merge pull request #3 from BuidlGuidl/with-theme
Update theme and design
2 parents af9d17a + b51a756 commit e2d68ba

File tree

19 files changed

+539
-255
lines changed

19 files changed

+539
-255
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ node_modules
1414

1515
# misc
1616
.DS_Store
17+
CLAUDE.md
1718

1819
# IDE
1920
.vscode
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import Image from "next/image";
2+
3+
interface AccentWrapperProps {
4+
children: React.ReactNode;
5+
}
6+
7+
export default function AccentWrapper({ children }: AccentWrapperProps) {
8+
return (
9+
<div className="relative overflow-hidden bg-slate-900 pb-24 lg:pb-48">
10+
<div
11+
className="absolute inset-0 size-full opacity-70 mix-blend-overlay dark:md:opacity-100"
12+
style={{
13+
background: "url(/noise.webp) lightgray 0% 0% / 83.69069695472717px 83.69069695472717px repeat",
14+
}}
15+
></div>
16+
<Image className="absolute top-0 opacity-50" src="/blur-cyan.png" alt="" width={530} height={530} />
17+
<Image className="absolute -top-64 -right-32" src="/blur-cyan.png" alt="" width={530} height={530} priority />
18+
<Image className="absolute -right-12 bottom-24" src="/blur-indigo.png" alt="" width={567} height={567} priority />
19+
{children}
20+
</div>
21+
);
22+
}

packages/nextjs/app/_components/ListVotings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const ListVotings = () => {
115115

116116
return (
117117
<div className="w-full">
118-
<ul className="w-full grid grid-cols-1 md:grid-cols-3 gap-4">
118+
<ul className="w-full grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
119119
{votings.length === 0 ? (
120120
<li className="col-span-1 md:col-span-3 bg-base-100 rounded-xl p-6 text-center opacity-70">
121121
No votings created yet.

packages/nextjs/app/_components/VotingOverview.tsx

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,25 @@
11
"use client";
22

3-
import { useState } from "react";
43
import ListVotings from "./ListVotings";
54
import OwnedVotings from "./OwnedVotings";
65
import ParticipatedVotings from "./ParticipatedVotings";
76

87
interface VotingOverviewProps {
9-
onCreateClick: () => void;
8+
activeTab: "all" | "owned" | "participated";
109
}
1110

12-
const VotingOverview = ({ onCreateClick }: VotingOverviewProps) => {
13-
const [activeTab, setActiveTab] = useState<"all" | "owned" | "participated">("owned");
14-
11+
const VotingOverview = ({ activeTab }: VotingOverviewProps) => {
1512
const tabs = [
16-
{ id: "owned" as const, label: "My Votings", component: OwnedVotings },
17-
{ id: "participated" as const, label: "I Can Vote", component: ParticipatedVotings },
18-
{ id: "all" as const, label: "All Votings", component: ListVotings },
13+
{ id: "owned" as const, component: OwnedVotings },
14+
{ id: "participated" as const, component: ParticipatedVotings },
15+
{ id: "all" as const, component: ListVotings },
1916
];
2017

2118
const ActiveComponent = tabs.find(tab => tab.id === activeTab)?.component || ListVotings;
2219

2320
return (
24-
<div className="w-full space-y-6">
25-
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
26-
<div className="tabs tabs-boxed w-fit">
27-
{tabs.map(tab => (
28-
<button
29-
key={tab.id}
30-
className={`tab text-2xl font-medium ${activeTab === tab.id ? "tab-active" : ""}`}
31-
onClick={() => setActiveTab(tab.id)}
32-
>
33-
{tab.label}
34-
</button>
35-
))}
36-
</div>
37-
38-
<button
39-
className="btn btn-primary gap-2 shadow-lg hover:scale-105 transition-transform"
40-
onClick={onCreateClick}
41-
>
42-
<svg
43-
className="w-6 h-6"
44-
fill="none"
45-
stroke="currentColor"
46-
viewBox="0 0 24 24"
47-
xmlns="http://www.w3.org/2000/svg"
48-
>
49-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
50-
</svg>
51-
Create Voting
52-
</button>
53-
</div>
54-
55-
<div className="w-full max-h-[calc(3*280px+2*1rem)] overflow-y-auto pr-2">
56-
<ActiveComponent />
57-
</div>
21+
<div className="w-full">
22+
<ActiveComponent />
5823
</div>
5924
);
6025
};

packages/nextjs/app/layout.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1+
import { Space_Grotesk } from "next/font/google";
12
import "@rainbow-me/rainbowkit/styles.css";
23
import { ScaffoldEthAppWithProviders } from "~~/components/ScaffoldEthAppWithProviders";
34
import { ThemeProvider } from "~~/components/ThemeProvider";
45
import "~~/styles/globals.css";
56
import { getMetadata } from "~~/utils/scaffold-eth/getMetadata";
67

8+
const spaceGrotesk = Space_Grotesk({
9+
subsets: ["latin"],
10+
variable: "--font-space-grotesk",
11+
display: "swap", // Controls font-display CSS property
12+
});
13+
714
export const metadata = getMetadata({
815
title: "Hidden Vote",
916
description: "Host private voting sessions. Votes stay secret, results stay transparent.",
1017
});
1118

1219
const ScaffoldEthApp = ({ children }: { children: React.ReactNode }) => {
1320
return (
14-
<html suppressHydrationWarning className={``}>
21+
<html suppressHydrationWarning className={spaceGrotesk.variable}>
1522
<body>
1623
<ThemeProvider enableSystem>
1724
<ScaffoldEthAppWithProviders>{children}</ScaffoldEthAppWithProviders>

0 commit comments

Comments
 (0)