style: Prettier format

This commit is contained in:
April Hall 2025-01-06 20:45:33 -05:00
parent d88f6e2bbf
commit 3232c21c69
Signed by: arithefirst
GPG Key ID: 4508A15C4DB91C5B
5 changed files with 17 additions and 22 deletions

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { type TypeMessage } from '../' import { type TypeMessage } from '../';
const { message, imageSrc, user }: TypeMessage = $props() const { message, imageSrc, user }: TypeMessage = $props();
</script> </script>
<div class="w-full hover:bg-base-300 bg-base-200 flex py-2"> <div class="w-full hover:bg-base-300 bg-base-200 flex py-2">

View File

@ -1,7 +1,7 @@
// place files you want to import through the `$lib` alias in this folder. // place files you want to import through the `$lib` alias in this folder.
export interface TypeMessage { export interface TypeMessage {
message: string, message: string;
imageSrc: string, imageSrc: string;
user: string; user: string;
} }

View File

@ -1,6 +1,6 @@
import { Server as SocketIOServer } from 'socket.io'; import { Server as SocketIOServer } from 'socket.io';
import type { HttpServer } from 'vite'; import type { HttpServer } from 'vite';
import { type TypeMessage } from './' import { type TypeMessage } from './';
let io: SocketIOServer | undefined; let io: SocketIOServer | undefined;
@ -13,14 +13,13 @@ export function startupSocketIOServer(httpServer: HttpServer | null) {
// Runs on client connect // Runs on client connect
console.log(`[ws:kit] client connected (${socket.id})`); console.log(`[ws:kit] client connected (${socket.id})`);
// Runs on message receive // Runs on message receive
socket.on('message', (msg) => { socket.on('message', (msg) => {
console.log(`[ws:kit] message from ${socket.id}: ${msg}`); console.log(`[ws:kit] message from ${socket.id}: ${msg}`);
io!.emit('message', { io!.emit('message', {
user: socket.id, user: socket.id,
message: msg, message: msg,
imageSrc: 'https://www.arithefirst.com/images/pfp.png' imageSrc: 'https://www.arithefirst.com/images/pfp.png',
}); });
}); });

View File

@ -50,11 +50,7 @@
</div> </div>
<div class="col-span-1 overflow-scroll bg-base-200 m-4 rounded-lg"> <div class="col-span-1 overflow-scroll bg-base-200 m-4 rounded-lg">
{#each log as message} {#each log as message}
<Message <Message imageSrc={message.imageSrc} user={message.user} message={message.message} />
imageSrc={message.imageSrc}
user={message.user}
message={message.message}
/>
{/each} {/each}
</div> </div>
</main> </main>