mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 15:00:30 +03:00
hide bubble for event content
This commit is contained in:
parent
622e67d565
commit
3b89ecebf0
3 changed files with 18 additions and 9 deletions
|
|
@ -34,7 +34,11 @@ export function EventContent({ messageLayout, time, iconSrc, content }: EventCon
|
|||
return <CompactLayout before={beforeJSX}>{msgContentJSX}</CompactLayout>;
|
||||
}
|
||||
if (messageLayout === MessageLayout.Bubble) {
|
||||
return <BubbleLayout before={beforeJSX}>{msgContentJSX}</BubbleLayout>;
|
||||
return (
|
||||
<BubbleLayout hideBubble before={beforeJSX}>
|
||||
{msgContentJSX}
|
||||
</BubbleLayout>
|
||||
);
|
||||
}
|
||||
return <ModernLayout before={beforeJSX}>{msgContentJSX}</ModernLayout>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,22 +5,27 @@ import * as css from './layout.css';
|
|||
|
||||
type BubbleLayoutProps = {
|
||||
self?: boolean;
|
||||
hideBubble?: boolean;
|
||||
before?: ReactNode;
|
||||
};
|
||||
|
||||
export const BubbleLayout = as<'div', BubbleLayoutProps>(
|
||||
({ self, before, children, ...props }, ref) => (
|
||||
({ self, hideBubble, before, children, ...props }, ref) => (
|
||||
<Box direction={self ? 'RowReverse' : 'Row'} gap="300" {...props} ref={ref}>
|
||||
<Box className={css.BubbleBefore} shrink="No">
|
||||
{before}
|
||||
</Box>
|
||||
<Box
|
||||
className={classNames(
|
||||
css.BubbleContent,
|
||||
before ? css.BubbleContentArrow : undefined,
|
||||
before && self ? css.BubbleContentArrowRight : undefined,
|
||||
before && !self ? css.BubbleContentArrowLeft : undefined
|
||||
)}
|
||||
className={
|
||||
hideBubble
|
||||
? undefined
|
||||
: classNames(
|
||||
css.BubbleContent,
|
||||
before ? css.BubbleContentArrow : undefined,
|
||||
before && self ? css.BubbleContentArrowRight : undefined,
|
||||
before && !self ? css.BubbleContentArrowLeft : undefined
|
||||
)
|
||||
}
|
||||
direction="Column"
|
||||
>
|
||||
{children}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ export const ModernBefore = style({
|
|||
export const BubbleBefore = style([
|
||||
ModernBefore,
|
||||
{
|
||||
minWidth: toRem(22),
|
||||
minWidth: toRem(24),
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue