Skip to content

Commit

Permalink
Chatbubble: use children instead of custom prop #21
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammedKpln committed Mar 26, 2022
1 parent 0d7d7aa commit 7c296b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/ChatBubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { ContextMenuWrapper } from './wrappers/ContextMenuWrapper';
const ParsedText = loadParsedText();

function _ChatBubble(props: IChatBubble) {
const { message, customContent } = props;
const { message, children } = props;
const propsContext = useContext(PropsContext);
const [mediaLoaded, setMediaLoaded] = useState<boolean>(false);
const [showMedia, setShowMedia] = useState<boolean>(false);
Expand Down Expand Up @@ -343,8 +343,8 @@ function _ChatBubble(props: IChatBubble) {
{ padding: message?.repliedTo ? 5 : 15 },
]}
>
{customContent ? (
customContent
{children ? (
children
) : (
<>
{message?.repliedTo && (
Expand Down
16 changes: 7 additions & 9 deletions src/components/TypingStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ function _TypingStatus(_: any, ref: Ref<ITypingStatusRef>) {
}

return (
<ChatBubble
customContent={
<LottieView
source={require('../assets/lottie/typing.json')}
autoPlay
style={{ width: 30 }}
/>
}
/>
<ChatBubble>
<LottieView
source={require('../assets/lottie/typing.json')}
autoPlay
style={{ width: 30 }}
/>
</ChatBubble>
);
} else {
if (propsContext?.renderTypingBubble) {
Expand Down

0 comments on commit 7c296b1

Please sign in to comment.