From fd7849c0b837c6ace7e39696c87924f88884d423 Mon Sep 17 00:00:00 2001 From: Dmytro Stanchiev Date: Thu, 14 Aug 2025 22:40:20 -0400 Subject: [PATCH] ui test --- src/app/layout.tsx | 27 ++++---- src/app/page.tsx | 153 +++++++++++++++------------------------------ 2 files changed, 62 insertions(+), 118 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f7fa87e..60c926c 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,21 +1,13 @@ import type { Metadata } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; +import { Inter } from "next/font/google"; import "./globals.css"; -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); +const inter = Inter({ subsets: ['latin'], variable: "--font-inter" }) -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); - -export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", -}; +export const metadata = { + title: 'iCal PWA', + description: 'Minimal PWA for calendar events', +} export default function RootLayout({ children, @@ -25,9 +17,12 @@ export default function RootLayout({ return ( - {children} +
+ iCal PWA +
+
{children}
); diff --git a/src/app/page.tsx b/src/app/page.tsx index c0bf507..69e304b 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,105 +1,54 @@ -import Image from "next/image"; +'use client' + +import { useState } from 'react' import { Button } from '@/components/ui/button' +import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog' +import { Input } from '@/components/ui/input' +import { nanoid } from 'nanoid' -export default function Home() { - return ( -
-
- Next.js logo -
    -
  1. - Get started by editing{" "} - - src/app/page.tsx - - . -
  2. -
  3. - Save and see your changes instantly. -
  4. -
- -
- - Vercel logomark - Deploy now - - - - Read our docs - -
-
- -
- ); +type Event = { + id: string + title: string + start: string + end?: string +} + +export default function HomePage() { + const [events, setEvents] = useState([]) + const [open, setOpen] = useState(false) + const [title, setTitle] = useState('') + const [start, setStart] = useState('') + + const addEvent = () => { + setEvents([...events, { id: nanoid(), title, start }]) + setTitle('') + setStart('') + setOpen(false) + } + + return ( +
+ +
    + {events.map(ev => ( +
  • + {ev.title} — {ev.start} +
  • + ))} +
+ + + + + Add Event + + setTitle(e.target.value)} /> + setStart(e.target.value)} /> + + + + + +
+ ) }