-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
playing with layout a bit - this is a discord-y option (#7115)
- Loading branch information
1 parent
b9f0d6e
commit ef2d393
Showing
3 changed files
with
65 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
<script lang="ts"> | ||
import type { BotMessageContext } from "openchat-client"; | ||
import { AvatarSize, OpenChat, userStore, type BotMessageContext } from "openchat-client"; | ||
import Markdown from "../home/Markdown.svelte"; | ||
import Avatar from "../Avatar.svelte"; | ||
import { getContext } from "svelte"; | ||
const client = getContext<OpenChat>("client"); | ||
interface Props { | ||
botContext: BotMessageContext; | ||
botName: string; | ||
} | ||
let { botContext }: Props = $props(); | ||
let text = $derived( | ||
`@UserId(${botContext.initiator}) executed command ${botContext.commandText}`, | ||
); | ||
let text = $derived(`@UserId(${botContext.initiator}) used **${botContext.commandText}**`); | ||
let user = $derived($userStore.get(botContext.initiator)); | ||
</script> | ||
|
||
<div class="bot-context"> | ||
{#if user} | ||
<Avatar url={client.userAvatarUrl(user)} userId={user.userId} size={AvatarSize.Tiny} /> | ||
{/if} | ||
<Markdown {text} /> | ||
</div> | ||
|
||
<style lang="scss"> | ||
.bot-context { | ||
@include font(light, normal, fs-80); | ||
margin-bottom: $sp4; | ||
color: var(--txt-light); | ||
display: flex; | ||
gap: $sp2; | ||
align-items: center; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters