From 1f980bb81374d239c4aa849c0752e0619fd60b1c Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Sat, 24 Feb 2024 15:10:18 +0100 Subject: [PATCH] Fixed tailwindcss and layout. --- src/package.json | 2 ++ src/pages/admin/admin.tsx | 30 ++++++++++++++++++++++++++---- src/pages/admin/layout.tsx | 28 ++++++++++++++++++++++++++++ src/tailwind.config.ts | 8 ++++---- 4 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 src/pages/admin/layout.tsx diff --git a/src/package.json b/src/package.json index a0a96610a..6701ebbfb 100644 --- a/src/package.json +++ b/src/package.json @@ -83,6 +83,8 @@ "etherpad-lite": "node/server.ts" }, "devDependencies": { + "autoprefixer": "^10.4.17", + "postcss": "^8.4.35", "@types/async": "^3.2.24", "@types/express": "^4.17.21", "@types/http-errors": "^2.0.4", diff --git a/src/pages/admin/admin.tsx b/src/pages/admin/admin.tsx index bfb7e54d4..f7ebaed9a 100644 --- a/src/pages/admin/admin.tsx +++ b/src/pages/admin/admin.tsx @@ -1,10 +1,32 @@ +import 'tailwindcss/tailwind.css' +import {connect} from 'socket.io-client' +import {useEffect} from "react"; + export const Admin = ()=>{ + + useEffect(() => { + const socket = connect('/settings') + + socket.on('connect', () => { + socket.emit('load'); + }); + + socket.on('disconnect', (reason) => { + // The socket.io client will automatically try to reconnect for all reasons other than "io + // server disconnect". + if (reason === 'io server disconnect') socket.connect(); + }); + + socket.on('settings', (settings) => { + console.log(settings) + }) + }, []); + + return( -