Skip to content

Commit 652be98

Browse files
committed
Make logo and name configurable
1 parent b0b90c4 commit 652be98

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

src/lib/Chatbox/Header.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<!-- Copyright (C) 2025 LiveMatrix -->
22
<script lang="ts">
3-
// TODO: Make Title and logo loadable from config
3+
import { chatConfig } from '$lib/state.svelte';
44
</script>
55

66
<div class="chat-titlebar">
7-
<h5>Chat UI</h5>
7+
<h5>Chat with {chatConfig.metadata.companyName}</h5>
88
<div class="chat-avatar">
9-
<img src="https://cdn.dribbble.com/users/37530/screenshots/2937858/drib_blink_bot.gif" alt="">
9+
<img src="{chatConfig.metadata.companyLogo}" alt="">
1010
</div>
1111
</div>
1212

src/lib/Chatbox/Session.svelte

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@
8282
}}
8383
>
8484
<fieldset disabled={isLoading}>
85-
<legend>Start a new chat</legend>
86-
<p>Please fill in your details to begin.</p>
85+
<legend>Welcome to {chatConfig.metadata.companyName}</legend>
86+
<p>If you want to inquire about our services or have a chat with our administrators, you are in the right place</p>
87+
<p style="font-size:smaller; opacity: 50%;">We ask for extra id, to contact you if we lose communication. <br>The chat is persistent between browser sessions, so you can come back here at any time, to continue our conversation.</p>
8788

8889
<div class="form-input">
8990
<input
@@ -94,7 +95,7 @@
9495
bind:value={postData.name}
9596
required
9697
/>
97-
<label for="name">Your Name</label>
98+
<label for="name">Your Name*</label>
9899
</div>
99100

100101
<div class="form-input">
@@ -105,7 +106,7 @@
105106
placeholder=""
106107
bind:value={postData.surname}
107108
/>
108-
<label for="surname">Phone Number*</label>
109+
<label for="surname">Phone Number</label>
109110
</div>
110111

111112
<div class="form-input">
@@ -117,7 +118,7 @@
117118
placeholder=""
118119
required
119120
/>
120-
<label for="email">E-mail address</label>
121+
<label for="email">E-mail address*</label>
121122
</div>
122123

123124
<button class="button-82-pushable" type="submit" aria-busy={isLoading}>

src/lib/state.svelte.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ export type Config = {
1313
host: string,
1414
port: number
1515
},
16-
greeting: string
16+
greeting: string,
17+
metadata: {
18+
companyName: string,
19+
companyLogo: string,
20+
}
1721
}
1822

1923
export const chatState = $state({

static/livematrix/config.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"host": "localhost",
1111
"port": 8000
1212
},
13-
"greeting": "Hello there, thanks for reaching out, i'll answer you asap"
13+
"greeting": "Hello there, thanks for reaching out, i'll answer you asap",
14+
"metadata": {
15+
"companyName": "LiveMatrix",
16+
"companyLogo": "/livematrix/logo.png"
17+
}
1418
}
1519
}

static/livematrix/logo.png

19.3 KB
Loading

0 commit comments

Comments
 (0)