mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 07:30:20 +00:00
feat(notifications): User Notifications
This commit is contained in:
@@ -11,9 +11,10 @@ type Props = {
|
||||
text?: string | string[];
|
||||
frequency?: number;
|
||||
className?: string;
|
||||
lottieClassName?: string;
|
||||
};
|
||||
|
||||
export const ContentLoader = ({ text, frequency = 2000, className }: Props) => {
|
||||
export const ContentLoader = ({ text, frequency = 2000, className, lottieClassName }: Props) => {
|
||||
const [pos, setPos] = useState(0);
|
||||
const isTextArray = Array.isArray(text);
|
||||
useEffect(() => {
|
||||
@@ -33,7 +34,11 @@ export const ContentLoader = ({ text, frequency = 2000, className }: Props) => {
|
||||
className
|
||||
)}
|
||||
>
|
||||
<Lottie isAutoPlay icon="infisical_loading" className="h-32 w-32" />
|
||||
<Lottie
|
||||
isAutoPlay
|
||||
icon="infisical_loading"
|
||||
className={twMerge("h-32 w-32", lottieClassName)}
|
||||
/>
|
||||
{text && isTextArray && (
|
||||
<AnimatePresence mode="wait">
|
||||
<motion.div
|
||||
|
||||
@@ -16,6 +16,7 @@ export type TooltipProps = Omit<TooltipPrimitive.TooltipContentProps, "open" | "
|
||||
center?: boolean;
|
||||
size?: "sm" | "md";
|
||||
rootProps?: RootProps;
|
||||
delayDuration?: number;
|
||||
};
|
||||
|
||||
export const Tooltip = ({
|
||||
@@ -31,12 +32,13 @@ export const Tooltip = ({
|
||||
position = "top",
|
||||
size = "md",
|
||||
rootProps,
|
||||
delayDuration = 50,
|
||||
...props
|
||||
}: TooltipProps) =>
|
||||
// just render children if tooltip content is empty
|
||||
content ? (
|
||||
<TooltipPrimitive.Root
|
||||
delayDuration={50}
|
||||
delayDuration={delayDuration}
|
||||
{...rootProps}
|
||||
open={isOpen}
|
||||
defaultOpen={defaultOpen}
|
||||
|
||||
Reference in New Issue
Block a user