docs: expanded rating form + UI docs improvement (#5211)
* docs: expanded rating form + UI docs improvement * added props table + changed example
This commit is contained in:
@@ -11,6 +11,7 @@ import { Button } from "@/components"
|
||||
|
||||
export type NotificationItemLayoutDefaultProps = NotificationItemProps & {
|
||||
handleClose: () => void
|
||||
closeButtonText?: string
|
||||
}
|
||||
|
||||
export const NotificationItemLayoutDefault: React.FC<
|
||||
@@ -23,6 +24,7 @@ export const NotificationItemLayoutDefault: React.FC<
|
||||
isClosable = true,
|
||||
handleClose,
|
||||
CustomIcon,
|
||||
closeButtonText = "Close",
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
@@ -74,7 +76,7 @@ export const NotificationItemLayoutDefault: React.FC<
|
||||
)}
|
||||
{isClosable && (
|
||||
<div className={clsx("p-docs_1 flex justify-end items-center")}>
|
||||
<Button onClick={handleClose}>Close</Button>
|
||||
<Button onClick={handleClose}>{closeButtonText}</Button>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -15,6 +15,7 @@ export type NotificationItemProps = {
|
||||
show?: boolean
|
||||
setShow?: (value: boolean) => void
|
||||
onClose?: () => void
|
||||
closeButtonText?: string
|
||||
} & React.HTMLAttributes<HTMLDivElement>
|
||||
|
||||
export const NotificationItem = ({
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import { NotificationItemType, useNotifications } from "@/providers"
|
||||
import {
|
||||
NotificationContextType,
|
||||
NotificationItemType,
|
||||
useNotifications,
|
||||
} from "@/providers"
|
||||
import React from "react"
|
||||
import { NotificationItem } from "./Item"
|
||||
import { CSSTransition, TransitionGroup } from "react-transition-group"
|
||||
import clsx from "clsx"
|
||||
|
||||
export const NotificationContainer = () => {
|
||||
const { notifications, removeNotification } = useNotifications()
|
||||
const { notifications, removeNotification } =
|
||||
useNotifications() as NotificationContextType
|
||||
|
||||
const handleClose = (notification: NotificationItemType) => {
|
||||
notification.onClose?.()
|
||||
@@ -25,8 +30,8 @@ export const NotificationContainer = () => {
|
||||
key={notification.id}
|
||||
timeout={200}
|
||||
classNames={{
|
||||
enter: "animate__animated animate__slideInRight animate__fastest",
|
||||
exit: "animate__animated animate__slideOutRight animate__fastest",
|
||||
enter: "animate-slideInRight animate-fast",
|
||||
exit: "animate-slideOutRight animate-fast",
|
||||
}}
|
||||
>
|
||||
<NotificationItem
|
||||
|
||||
Reference in New Issue
Block a user