mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
fix(chat-bubble): adjust message padding and layout styles
This commit is contained in:
parent
2605b211bc
commit
4ec1943738
@ -28,7 +28,7 @@ const chatBubbleVariant = cva(
|
|||||||
|
|
||||||
interface ChatBubbleProps
|
interface ChatBubbleProps
|
||||||
extends React.HTMLAttributes<HTMLDivElement>,
|
extends React.HTMLAttributes<HTMLDivElement>,
|
||||||
VariantProps<typeof chatBubbleVariant> {}
|
VariantProps<typeof chatBubbleVariant> { }
|
||||||
|
|
||||||
const ChatBubble = React.forwardRef<HTMLDivElement, ChatBubbleProps>(
|
const ChatBubble = React.forwardRef<HTMLDivElement, ChatBubbleProps>(
|
||||||
({ className, variant, layout, children, ...props }, ref) => (
|
({ className, variant, layout, children, ...props }, ref) => (
|
||||||
@ -43,9 +43,9 @@ const ChatBubble = React.forwardRef<HTMLDivElement, ChatBubbleProps>(
|
|||||||
{React.Children.map(children, (child) =>
|
{React.Children.map(children, (child) =>
|
||||||
React.isValidElement(child) && typeof child.type !== "string"
|
React.isValidElement(child) && typeof child.type !== "string"
|
||||||
? React.cloneElement(child, {
|
? React.cloneElement(child, {
|
||||||
variant,
|
variant,
|
||||||
layout,
|
layout,
|
||||||
} as React.ComponentProps<typeof child.type>)
|
} as React.ComponentProps<typeof child.type>)
|
||||||
: child,
|
: child,
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -72,7 +72,7 @@ const ChatBubbleAvatar: React.FC<ChatBubbleAvatarProps> = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
// ChatBubbleMessage
|
// ChatBubbleMessage
|
||||||
const chatBubbleMessageVariants = cva("p-4", {
|
const chatBubbleMessageVariants = cva("p-0", {
|
||||||
variants: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
received:
|
received:
|
||||||
@ -81,7 +81,7 @@ const chatBubbleMessageVariants = cva("p-4", {
|
|||||||
},
|
},
|
||||||
layout: {
|
layout: {
|
||||||
default: "",
|
default: "",
|
||||||
ai: "border-t w-full rounded-none bg-transparent",
|
ai: "w-full rounded-none bg-transparent",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
@ -92,7 +92,7 @@ const chatBubbleMessageVariants = cva("p-4", {
|
|||||||
|
|
||||||
interface ChatBubbleMessageProps
|
interface ChatBubbleMessageProps
|
||||||
extends React.HTMLAttributes<HTMLDivElement>,
|
extends React.HTMLAttributes<HTMLDivElement>,
|
||||||
VariantProps<typeof chatBubbleMessageVariants> {
|
VariantProps<typeof chatBubbleMessageVariants> {
|
||||||
isLoading?: boolean;
|
isLoading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user