-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
527 additions
and
340 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
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
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,46 @@ | ||
import { RiErrorWarningLine } from "react-icons/ri"; | ||
import { tv } from "tailwind-variants"; | ||
import clsx from "clsx"; | ||
|
||
import { createComponent } from "."; | ||
|
||
const notification = tv({ | ||
base: "w-full flex items-start text-sm justify-center gap-1 text-base", | ||
variants: { | ||
variant: { | ||
default: "text-blue-400", | ||
block: "text-blue-700 bg-blue-400 border border-blue-700 rounded-lg p-4", | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: "default", | ||
}, | ||
}); | ||
|
||
const NotificationContainer = createComponent("div", notification); | ||
|
||
interface NotificationProps { | ||
content: string; | ||
variant?: string; | ||
italic?: boolean; | ||
title?: string; | ||
} | ||
|
||
export const Notification = ({ | ||
content, | ||
variant, | ||
italic, | ||
title, | ||
}: NotificationProps) => { | ||
return ( | ||
<NotificationContainer variant={variant}> | ||
<span className="pt-1"> | ||
<RiErrorWarningLine /> | ||
</span> | ||
<div> | ||
<b>{title ?? null}</b> | ||
<p className={clsx("text-sm", italic ? "italic" : "")}>{content}</p> | ||
</div> | ||
</NotificationContainer> | ||
); | ||
}; |
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
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
Oops, something went wrong.