Fix issue with ToastContainer classes

This commit is contained in:
Michael
2021-08-13 21:09:04 +02:00
parent 834f7fc848
commit ce9f0a3cfe
2 changed files with 4 additions and 26 deletions

View File

@@ -25,24 +25,6 @@ type LayoutProps = {
const Layout = ({ children }: LayoutProps): JSX.Element => {
const { user, signOut } = useAuth();
type toast = {
success: string;
error: string;
info: string;
warning: string;
default: string;
dark: string;
};
const toastStyle: toast = {
// Style your toast elements here
success: 'bg-accent',
error: 'bg-red-600',
info: 'bg-gray-600',
warning: 'bg-orange-400',
default: 'bg-primary',
dark: 'bg-white-600 font-gray-300',
};
return (
<div className="min-h-screen w-full bg-base-100 text-base-content m-auto font-body">
<Head>
@@ -57,14 +39,7 @@ const Layout = ({ children }: LayoutProps): JSX.Element => {
<div className="max-w-7xl flex flex-col min-h-screen mx-auto p-5">
<Nav user={user} signOut={signOut} />
<main className="flex-1">{children}</main>
<ToastContainer
position="bottom-center"
toastClassName={({ type }) =>
`${
toastStyle[type || 'default']
} flex p-5 my-5 min-h-10 rounded-md justify-between overflow-hidden cursor-pointer `
}
/>
<ToastContainer position="bottom-center" />
<Footer />
</div>
</div>

3
next-env.d.ts vendored
View File

@@ -1,3 +1,6 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.