diff --git a/web/components/chat/ChatSocialMessage/ChatSocialMessage.module.scss b/web/components/chat/ChatSocialMessage/ChatSocialMessage.module.scss new file mode 100644 index 000000000..23f1f150d --- /dev/null +++ b/web/components/chat/ChatSocialMessage/ChatSocialMessage.module.scss @@ -0,0 +1,52 @@ +.follower { + border-color: rgba(0, 0, 0, 0.3); + border-width: 1px; + border-style: solid; + padding: 10px 10px; + border-radius: 15px; + height: 85px; + width: 300px; + overflow: hidden; + + &:hover { + border-color: var(--theme-text-link); + } + + .avatar { + height: 60px; + width: 60px; + border-color: rgba(0, 0, 0, 0.3); + border-width: 1px; + border-style: solid; + } + + .body { + color: var(--theme-color-components-text-on-light); + text-overflow: ellipsis; + } + + .account { + font-family: var(--theme-text-display-font-family); + font-weight: 600; + color: var(--theme-color-components-text-on-light); + } + + .icon { + position: relative; + width: 25px; + height: 25px; + top: -20px; + left: 40px; + border-color: white; + border-width: 1px; + border-style: solid; + border-radius: 50%; + background-size: cover; + background-position: center; + } + + .placeholder { + width: 100%; + height: 100%; + } +} diff --git a/web/components/chat/ChatSocialMessage/ChatSocialMessage.stories.tsx b/web/components/chat/ChatSocialMessage/ChatSocialMessage.stories.tsx index be8c07c04..b1cd8f036 100644 --- a/web/components/chat/ChatSocialMessage/ChatSocialMessage.stories.tsx +++ b/web/components/chat/ChatSocialMessage/ChatSocialMessage.stories.tsx @@ -8,8 +8,37 @@ export default { parameters: {}, } as ComponentMeta; -// eslint-disable-next-line @typescript-eslint/no-unused-vars const Template: ComponentStory = args => ; -// eslint-disable-next-line @typescript-eslint/no-unused-vars -export const Basic = Template.bind({}); +export const Follow = Template.bind({}); +Follow.args = { + message: { + type: 'follow', + body: 'james followed this live stream.', + title: 'james@mastodon.social', + image: 'https://mastodon.social/avatars/original/missing.png', + link: 'https://mastodon.social/@james', + }, +}; + +export const Like = Template.bind({}); +Like.args = { + message: { + type: 'like', + body: 'james liked that this stream went live.', + title: 'james@mastodon.social', + image: 'https://mastodon.social/avatars/original/missing.png', + link: 'https://mastodon.social/@james', + }, +}; + +export const Repost = Template.bind({}); +Repost.args = { + message: { + type: 'repost', + body: 'james shared this stream with their followers.', + title: 'james@mastodon.social', + image: 'https://mastodon.social/avatars/original/missing.png', + link: 'https://mastodon.social/@james', + }, +}; diff --git a/web/components/chat/ChatSocialMessage/ChatSocialMessage.tsx b/web/components/chat/ChatSocialMessage/ChatSocialMessage.tsx index 9e94fe9d2..fd2d022c0 100644 --- a/web/components/chat/ChatSocialMessage/ChatSocialMessage.tsx +++ b/web/components/chat/ChatSocialMessage/ChatSocialMessage.tsx @@ -1,11 +1,52 @@ -/* eslint-disable react/no-unused-prop-types */ -/* eslint-disable @typescript-eslint/no-unused-vars */ -// TODO remove unused props -import { FC } from 'react'; -import { ChatMessage } from '../../../interfaces/chat-message.model'; +import { Avatar, Col, Row } from 'antd'; +import dynamic from 'next/dynamic'; +import React, { FC } from 'react'; +import { ChatSocialMessage as ChatMessage } from '../../../interfaces/chat-social-message.model'; +import styles from './ChatSocialMessage.module.scss'; + +const FollowIcon = dynamic(() => import('./follow.svg')); +const LikeIcon = dynamic(() => import('./like.svg')); +const RepostIcon = dynamic(() => import('./repost.svg')); export interface ChatSocialMessageProps { message: ChatMessage; } -export const ChatSocialMessage: FC = () =>
Component goes here
; +export const ChatSocialMessage: FC = ({ message }) => { + const { body, title, image, link, type } = message; + + let Icon; + + switch (type.toString()) { + case 'follow': + Icon = FollowIcon; + break; + case 'like': + Icon = LikeIcon; + break; + case 'repost': + Icon = RepostIcon; + break; + default: + break; + } + + return ( + + ); +}; diff --git a/web/components/chat/ChatSocialMessage/follow.svg b/web/components/chat/ChatSocialMessage/follow.svg new file mode 100644 index 000000000..35a71d77b --- /dev/null +++ b/web/components/chat/ChatSocialMessage/follow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/components/chat/ChatSocialMessage/like.svg b/web/components/chat/ChatSocialMessage/like.svg new file mode 100644 index 000000000..e03908be0 --- /dev/null +++ b/web/components/chat/ChatSocialMessage/like.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/components/chat/ChatSocialMessage/repost.svg b/web/components/chat/ChatSocialMessage/repost.svg new file mode 100644 index 000000000..2d5dd0a20 --- /dev/null +++ b/web/components/chat/ChatSocialMessage/repost.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/interfaces/chat-social-message.model.ts b/web/interfaces/chat-social-message.model.ts new file mode 100644 index 000000000..7ae0d02fa --- /dev/null +++ b/web/interfaces/chat-social-message.model.ts @@ -0,0 +1,8 @@ +import { SocketEvent } from './socket-events'; + +export interface ChatSocialMessage extends SocketEvent { + title: string; + body: string; + image: string; + link: string; +}