Allow social chat events to fit content. Use text fallback in avatar. Closes #2719
This commit is contained in:
@@ -4,9 +4,6 @@
|
|||||||
border-style: solid;
|
border-style: solid;
|
||||||
padding: 10px 10px;
|
padding: 10px 10px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
height: 85px;
|
|
||||||
width: 300px;
|
|
||||||
overflow: hidden;
|
|
||||||
background-color: var(--theme-color-background-main);
|
background-color: var(--theme-color-background-main);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
@@ -19,6 +16,12 @@
|
|||||||
border-color: rgba(0, 0, 0, 0.3);
|
border-color: rgba(0, 0, 0, 0.3);
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
|
font-size: 1.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatarColumn {
|
||||||
|
max-width: 75px;
|
||||||
|
min-width: 75px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.body {
|
.body {
|
||||||
@@ -34,10 +37,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
position: relative;
|
position: absolute;
|
||||||
width: 25px;
|
width: 25px;
|
||||||
height: 25px;
|
height: 25px;
|
||||||
top: -20px;
|
top: 40px;
|
||||||
left: 40px;
|
left: 40px;
|
||||||
border-color: var(--theme-color-background-main);
|
border-color: var(--theme-color-background-main);
|
||||||
border-width: 2px;
|
border-width: 2px;
|
||||||
@@ -46,9 +49,4 @@
|
|||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.placeholder {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,3 +42,25 @@ Repost.args = {
|
|||||||
link: 'https://mastodon.social/@james',
|
link: 'https://mastodon.social/@james',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const LongAccountName = Template.bind({});
|
||||||
|
LongAccountName.args = {
|
||||||
|
message: {
|
||||||
|
type: 'FEDIVERSE_ENGAGEMENT_REPOST',
|
||||||
|
body: 'james shared this stream with their followers.',
|
||||||
|
title: 'littlejimmywilliams@technology.biz.net.org.technology.gov',
|
||||||
|
image: 'https://mastodon.social/avatars/original/missing.png',
|
||||||
|
link: 'https://mastodon.social/@james',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const InvalidAvatarImage = Template.bind({});
|
||||||
|
InvalidAvatarImage.args = {
|
||||||
|
message: {
|
||||||
|
type: 'FEDIVERSE_ENGAGEMENT_REPOST',
|
||||||
|
body: 'james shared this stream with their followers.',
|
||||||
|
title: 'james@mastodon.social',
|
||||||
|
image: 'https://xx.xx/avatars/original/missing.png',
|
||||||
|
link: 'https://mastodon.social/@james',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|||||||
@@ -42,10 +42,11 @@ export const ChatSocialMessage: FC<ChatSocialMessageProps> = ({ message }) => {
|
|||||||
<div className={cn([styles.follower, 'chat-message_social'])}>
|
<div className={cn([styles.follower, 'chat-message_social'])}>
|
||||||
<a href={link} target="_blank" rel="noreferrer">
|
<a href={link} target="_blank" rel="noreferrer">
|
||||||
<Row wrap={false}>
|
<Row wrap={false}>
|
||||||
<Col span={6}>
|
<Col span={6} className={styles.avatarColumn}>
|
||||||
<Avatar src={image} alt="Avatar" className={styles.avatar}>
|
<Avatar src={image} alt="Avatar" className={styles.avatar} size="large">
|
||||||
<img src="/logo" alt="Logo" className={styles.placeholder} />
|
{title.charAt(0).toUpperCase()}
|
||||||
</Avatar>
|
</Avatar>
|
||||||
|
|
||||||
<Icon className={styles.icon} />
|
<Icon className={styles.icon} />
|
||||||
</Col>
|
</Col>
|
||||||
<Col>
|
<Col>
|
||||||
|
|||||||
Reference in New Issue
Block a user