style: Prettier format
This commit is contained in:
parent
d88f6e2bbf
commit
3232c21c69
@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { type TypeMessage } from '../'
|
||||
const { message, imageSrc, user }: TypeMessage = $props()
|
||||
import { type TypeMessage } from '../';
|
||||
const { message, imageSrc, user }: TypeMessage = $props();
|
||||
</script>
|
||||
|
||||
<div class="w-full hover:bg-base-300 bg-base-200 flex py-2">
|
||||
|
@ -1,7 +1,7 @@
|
||||
// place files you want to import through the `$lib` alias in this folder.
|
||||
|
||||
export interface TypeMessage {
|
||||
message: string,
|
||||
imageSrc: string,
|
||||
message: string;
|
||||
imageSrc: string;
|
||||
user: string;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import { Server as SocketIOServer } from 'socket.io';
|
||||
import type { HttpServer } from 'vite';
|
||||
import { type TypeMessage } from './'
|
||||
import { type TypeMessage } from './';
|
||||
|
||||
let io: SocketIOServer | undefined;
|
||||
|
||||
@ -13,14 +13,13 @@ export function startupSocketIOServer(httpServer: HttpServer | null) {
|
||||
// Runs on client connect
|
||||
console.log(`[ws:kit] client connected (${socket.id})`);
|
||||
|
||||
|
||||
// Runs on message receive
|
||||
socket.on('message', (msg) => {
|
||||
console.log(`[ws:kit] message from ${socket.id}: ${msg}`);
|
||||
io!.emit('message', {
|
||||
user: socket.id,
|
||||
message: msg,
|
||||
imageSrc: 'https://www.arithefirst.com/images/pfp.png'
|
||||
imageSrc: 'https://www.arithefirst.com/images/pfp.png',
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -50,11 +50,7 @@
|
||||
</div>
|
||||
<div class="col-span-1 overflow-scroll bg-base-200 m-4 rounded-lg">
|
||||
{#each log as message}
|
||||
<Message
|
||||
imageSrc={message.imageSrc}
|
||||
user={message.user}
|
||||
message={message.message}
|
||||
/>
|
||||
<Message imageSrc={message.imageSrc} user={message.user} message={message.message} />
|
||||
{/each}
|
||||
</div>
|
||||
</main>
|
Loading…
Reference in New Issue
Block a user