Skip to content

Commit

Permalink
new: message skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris committed Aug 18, 2022
1 parent 07e8c04 commit 1264ae4
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import MessageContentBody from './MessageContentBody';
import ReactionsList from './MessageReactionsList';
import ReadReceipt from './MessageReadReceipt';
import PreviewList from './UrlPreview';
import VideoConfMessages from './VideoConfMessage/VideoConfMessages';

const MessageContent: FC<{ message: IMessage; sequential: boolean; subscription?: ISubscription; id: IMessage['_id'] }> = ({
message,
Expand Down Expand Up @@ -57,6 +58,7 @@ const MessageContent: FC<{ message: IMessage; sequential: boolean; subscription?
)}
{message.blocks && (
<MessageBlock fixedWidth>
{message?.blocks?.map((block, index) => block.appId === 'videoconf-core' && <VideoConfMessages key={index} />)}
<MessageBlockUiKit mid={message._id} blocks={message.blocks} appId rid={message.rid} />
</MessageBlock>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Button } from '@rocket.chat/fuselage';
import { VideoConfMessage, VideoConfMessageIcon, VideoConfMessageRow, VideoConfMessageText } from '@rocket.chat/ui-video-conf';
import React, { ReactElement } from 'react';

const VideoConfMessages = (): ReactElement => {
console.log('videconfmessage');

return (
<VideoConfMessage>
<VideoConfMessageRow>
<VideoConfMessageIcon name='phone-off' backgroundColor='neutral-400' color='neutral-700' />
<VideoConfMessageText fontScale='c2'>Call ended</VideoConfMessageText>
</VideoConfMessageRow>
<VideoConfMessageRow backgroundColor='neutral-100'>
<Button small secondary>
Call back
</Button>
<VideoConfMessageText>Call was not answered</VideoConfMessageText>
</VideoConfMessageRow>
</VideoConfMessage>
);
};

export default VideoConfMessages;
12 changes: 12 additions & 0 deletions packages/ui-video-conf/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
"stories": [
"../src/**/*.stories.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions"
],
"framework": "@storybook/react"
}
7 changes: 0 additions & 7 deletions packages/ui-video-conf/.storybook/main.ts

This file was deleted.

25 changes: 25 additions & 0 deletions packages/ui-video-conf/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import '../../../apps/meteor/app/theme/client/main.css';
import 'highlight.js/styles/github.css';

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}

export const decorators = [
(Story) => (
<div className="rc-old">
<style>{`
body {
background-color: white;
}
`}</style>
<Story />
</div>
)
];
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { ReactElement } from 'react';

import '@rocket.chat/icons/dist/rocketchat.css';
import { VideoConfMessage, VideoConfMessageIcon, VideoConfMessageRow, VideoConfMessageText } from '.';
import VideoConfMessageSkeleton from './VideoConfMessageSkeleton';

export default {
title: 'Components/VideoConfMessage',
Expand Down Expand Up @@ -116,3 +117,5 @@ export const CallEnded: ComponentStory<typeof VideoConfMessage> = () => (
</VideoConfMessageRow>
</VideoConfMessage>
);

export const Loading: ComponentStory<typeof VideoConfMessage> = () => <VideoConfMessageSkeleton />;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Skeleton } from '@rocket.chat/fuselage';
import type { ReactElement } from 'react';

import VideoConfMessage from './VideoConfMessage';
import VideoConfMessageRow from './VideoConfMessageRow';

const VideoConfMessageSkeleton = (): ReactElement => (
<VideoConfMessage>
<VideoConfMessageRow>
<Skeleton width='full' />
</VideoConfMessageRow>
<VideoConfMessageRow backgroundColor='neutral-100'>
<Skeleton width='full' />
</VideoConfMessageRow>
</VideoConfMessage>
);

export default VideoConfMessageSkeleton;

0 comments on commit 1264ae4

Please sign in to comment.