Updated styles to match design for chat msgs
This commit is contained in:
@@ -53,9 +53,10 @@ function shouldCollapseMessages(messages: ChatMessage[], index: number): boolean
|
|||||||
return id === lastMessage?.user.id;
|
return id === lastMessage?.user.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkIsModerator(message) {
|
function checkIsModerator(message: ChatMessage | ConnectedClientInfoEvent) {
|
||||||
const { user } = message;
|
const {
|
||||||
const { scopes } = user;
|
user: { scopes },
|
||||||
|
} = message;
|
||||||
|
|
||||||
if (!scopes || scopes.length === 0) {
|
if (!scopes || scopes.length === 0) {
|
||||||
return false;
|
return false;
|
||||||
@@ -97,8 +98,9 @@ export const ChatContainer: FC<ChatContainerProps> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getUserJoinedMessage = (message: ChatMessage) => {
|
const getUserJoinedMessage = (message: ChatMessage) => {
|
||||||
const { user } = message;
|
const {
|
||||||
const { displayName, displayColor } = user;
|
user: { displayName, displayColor },
|
||||||
|
} = message;
|
||||||
const isAuthorModerator = checkIsModerator(message);
|
const isAuthorModerator = checkIsModerator(message);
|
||||||
return (
|
return (
|
||||||
<ChatJoinMessage
|
<ChatJoinMessage
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
|
$border-style: 3px solid currentColor;
|
||||||
|
$p-size: 5px;
|
||||||
|
|
||||||
.root {
|
.root {
|
||||||
* {
|
* {
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
border-right: 2px solid currentColor;
|
border-left: $border-style;
|
||||||
position: relative;
|
position: relative;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
padding: 0px 15px 5px 5px;
|
padding: 0px $p-size $p-size $p-size;
|
||||||
padding-left: 1rem;
|
|
||||||
.user {
|
.user {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -17,7 +19,7 @@
|
|||||||
.message {
|
.message {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
color: var(--theme-color-components-chat-text);
|
font-weight: 600;
|
||||||
|
|
||||||
mark {
|
mark {
|
||||||
padding-left: 0.35em;
|
padding-left: 0.35em;
|
||||||
@@ -27,9 +29,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.ownMessage {
|
&.ownMessage {
|
||||||
border-right: none;
|
|
||||||
border-left: 2px solid currentColor;
|
|
||||||
|
|
||||||
.background {
|
.background {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
@@ -61,5 +60,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.messagePadding {
|
.messagePadding {
|
||||||
padding: 0px 3px;
|
padding: 0px 0px;
|
||||||
|
padding-top: .4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.messagePaddingCollapsed {
|
||||||
|
padding: 0px 0px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user