Sets up the project structure, including essential configuration files (eslint, postcss, tailwind), initial React components, and core UI component library (shadcn/ui). Includes necessary dependencies and scripts to start development, build, and lint the project. Ensures correct setup of React Router and a basic App structure. Does this address a real problem or an imagined one? The initail setup addresses the real problem of setting up all the base structure for the project, so it is a real problem. Is there a simpler way to do this? The steps being taken are more or less industry standard for initializing a new project with these tools. What will break? None of these changes will break anything; this is a new project setup.
29 lines
880 B
TypeScript
29 lines
880 B
TypeScript
import { useTheme } from "next-themes"
|
|
import { Toaster as Sonner } from "sonner"
|
|
|
|
type ToasterProps = React.ComponentProps<typeof Sonner>
|
|
|
|
const Toaster = ({ ...props }: ToasterProps) => {
|
|
const { theme = "system" } = useTheme()
|
|
|
|
return (
|
|
<Sonner
|
|
theme={theme as ToasterProps["theme"]}
|
|
className="toaster group"
|
|
toastOptions={{
|
|
classNames: {
|
|
toast:
|
|
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
description: "group-[.toast]:text-muted-foreground",
|
|
actionButton:
|
|
"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
cancelButton:
|
|
"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
},
|
|
}}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export { Toaster }
|