2022-04-24 20:14:04 +03:00
|
|
|
<script>
|
2022-04-26 23:15:49 +03:00
|
|
|
import { MoreVerticalIcon } from "svelte-feather-icons";
|
|
|
|
import { overlayStore } from "../stores";
|
|
|
|
|
2022-04-24 20:14:04 +03:00
|
|
|
export let message;
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.message {
|
2022-04-26 23:44:06 +03:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2022-04-24 20:14:04 +03:00
|
|
|
overflow-x: none;
|
|
|
|
word-break: break-all;
|
2022-04-26 23:44:06 +03:00
|
|
|
padding: 1px var(--space-normplus) 1px var(--space-normplus);
|
2022-04-24 20:14:04 +03:00
|
|
|
}
|
|
|
|
|
2022-04-26 23:15:49 +03:00
|
|
|
.message .edit-message {
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.message:hover {
|
|
|
|
background-color: var(--background-color-2);
|
|
|
|
}
|
|
|
|
|
|
|
|
.message:hover .edit-message {
|
|
|
|
visibility: visible;
|
|
|
|
}
|
|
|
|
|
2022-04-24 20:14:04 +03:00
|
|
|
.message-content {
|
|
|
|
color: var(--foreground-color-2);
|
|
|
|
}
|
|
|
|
|
|
|
|
.pending {
|
|
|
|
color: var(--foreground-color-3);
|
|
|
|
}
|
|
|
|
|
|
|
|
.author {
|
2022-04-26 23:44:06 +03:00
|
|
|
flex-shrink: 0;
|
2022-04-24 20:14:04 +03:00
|
|
|
font-weight: bold;
|
2022-04-26 23:44:06 +03:00
|
|
|
margin-right: var(--space-xs);
|
2022-04-24 20:14:04 +03:00
|
|
|
}
|
2022-04-26 23:15:49 +03:00
|
|
|
|
|
|
|
.edit-message {
|
2022-04-26 23:44:06 +03:00
|
|
|
flex-shrink: 0;
|
2022-04-26 23:15:49 +03:00
|
|
|
float: right;
|
|
|
|
}
|
2022-04-24 20:14:04 +03:00
|
|
|
</style>
|
|
|
|
|
|
|
|
<div class="message">
|
|
|
|
<span class="author">{ message.author_username }</span>
|
|
|
|
<span class="message-content" class:pending={ message._isPending }>{ message.content }</span>
|
2022-04-26 23:15:49 +03:00
|
|
|
<button class="icon-button edit-message" on:click="{ () => overlayStore.open('editMessage', { message }) }">
|
|
|
|
<MoreVerticalIcon />
|
|
|
|
</button>
|
2022-04-24 20:14:04 +03:00
|
|
|
</div>
|