-
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.
feat: remove prop drill, add messages (#647)
- Loading branch information
1 parent
a28e8b1
commit f3493d2
Showing
12 changed files
with
247 additions
and
53 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": "slate", | ||
"cssVariables": true, | ||
"prefix": "" | ||
}, | ||
"aliases": { | ||
"components": "@/components", | ||
"utils": "@/lib/utils", | ||
"ui": "@/components/ui", | ||
"lib": "@/lib", | ||
"hooks": "@/hooks" | ||
}, | ||
"iconLibrary": "lucide" | ||
} |
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 |
---|---|---|
@@ -1,30 +1,16 @@ | ||
import type { Metadata } from 'next' | ||
import { Geist, Geist_Mono } from 'next/font/google' | ||
import { inter } from '@/lib/fonts' | ||
import './globals.css' | ||
|
||
const geistSans = Geist({ | ||
variable: '--font-geist-sans', | ||
subsets: ['latin'], | ||
}) | ||
|
||
const geistMono = Geist_Mono({ | ||
variable: '--font-geist-mono', | ||
subsets: ['latin'], | ||
}) | ||
|
||
export const metadata: Metadata = { | ||
title: 'Find Boba Store', | ||
description: 'Find Boba Store', | ||
description: 'Find the best boba stores near you', | ||
} | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: Readonly<{ | ||
children: React.ReactNode | ||
}>) { | ||
export default function RootLayout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<html lang="en"> | ||
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>{children}</body> | ||
<html lang="en" className={inter.variable}> | ||
<body className="font-sans antialiased">{children}</body> | ||
</html> | ||
) | ||
} |
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,13 +1,12 @@ | ||
import { MapView } from '@/components/map-view' | ||
|
||
export default async function Home() { | ||
const mapboxToken = process.env.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN | ||
export default function Home() { | ||
return ( | ||
<main className="relative w-full h-screen"> | ||
<div className="absolute top-4 left-4 z-10 bg-slate-900/50 px-4 py-2 rounded-lg"> | ||
<h1 className="text-xl font-bold text-white">Find Boba Store</h1> | ||
</div> | ||
<MapView token={mapboxToken} /> | ||
<MapView /> | ||
</main> | ||
) | ||
} |
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,20 @@ | ||
import { AlertCircle } from 'lucide-react' | ||
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert' | ||
import { cn } from '@/lib/utils' | ||
import type { ReactNode } from 'react' | ||
|
||
interface ErrorMessageProps { | ||
title: string | ||
description?: ReactNode | ||
className?: string | ||
} | ||
|
||
export function ErrorMessage({ title, description, className }: ErrorMessageProps) { | ||
return ( | ||
<Alert variant="destructive" className={cn('border-red-900/50 bg-red-900/10', className)}> | ||
<AlertCircle className="h-4 w-4" /> | ||
<AlertTitle>{title}</AlertTitle> | ||
{description && <AlertDescription>{description}</AlertDescription>} | ||
</Alert> | ||
) | ||
} |
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 * as React from 'react' | ||
import { cva, type VariantProps } from 'class-variance-authority' | ||
|
||
import { cn } from '@/lib/utils' | ||
|
||
const alertVariants = cva( | ||
'relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7', | ||
{ | ||
variants: { | ||
variant: { | ||
default: 'bg-background text-foreground', | ||
destructive: 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive', | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: 'default', | ||
}, | ||
}, | ||
) | ||
|
||
const Alert = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>>( | ||
({ className, variant, ...props }, ref) => ( | ||
<div ref={ref} role="alert" className={cn(alertVariants({ variant }), className)} {...props} /> | ||
), | ||
) | ||
Alert.displayName = 'Alert' | ||
|
||
const AlertTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(({ className, ...props }, ref) => ( | ||
<h5 ref={ref} className={cn('mb-1 font-medium leading-none tracking-tight', className)} {...props} /> | ||
)) | ||
AlertTitle.displayName = 'AlertTitle' | ||
|
||
const AlertDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>( | ||
({ className, ...props }, ref) => <div ref={ref} className={cn('text-sm [&_p]:leading-relaxed', className)} {...props} />, | ||
) | ||
AlertDescription.displayName = 'AlertDescription' | ||
|
||
export { Alert, AlertTitle, AlertDescription } |
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,7 @@ | ||
import { Inter } from 'next/font/google' | ||
|
||
export const inter = Inter({ | ||
subsets: ['latin'], | ||
display: 'swap', | ||
variable: '--font-inter', | ||
}) |
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
Oops, something went wrong.