From 0af032895a97166269b23cf1510086857cacefa9 Mon Sep 17 00:00:00 2001 From: Branislav Hozza Date: Sat, 13 Apr 2024 12:55:21 +0200 Subject: [PATCH 1/6] :recycle: redisegn layout and remove naive-ui --- .env.example | 1 + app.config.ts | 28 +-------- app.vue | 25 +------- components/chat/ChatRow.vue | 18 +++--- components/chat/MessageSender.vue | 4 +- components/layout/LeftSideContent.vue | 52 ++++++++++------ components/layout/NavigationComponent.vue | 20 +++++-- .../{LeftSideChat.vue => RightSideChat.vue} | 60 +++++++++++++------ components/layout/RightSideContent.vue | 13 ---- layouts/chat.vue | 40 ++++--------- layouts/default.vue | 36 +++-------- layouts/plain.vue | 37 ++++-------- nuxt.config.ts | 1 - package.json | 1 - pages/chat/index.vue | 4 +- pages/index.vue | 3 - 16 files changed, 139 insertions(+), 204 deletions(-) rename components/layout/{LeftSideChat.vue => RightSideChat.vue} (69%) delete mode 100644 components/layout/RightSideContent.vue diff --git a/.env.example b/.env.example index 31b2d4d..ff7c6a8 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,6 @@ # REST API configuration REST_API_URL= +SIGNAL_R_URL= # .NET backend runs locally on HTTPS (must be set to 0), for production must be set to 1 NODE_TLS_REJECT_UNAUTHORIZED= diff --git a/app.config.ts b/app.config.ts index 96755d7..b2d0682 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,27 +1 @@ -import { _colors, _fontFamily } from '#tailwind-config/theme.mjs'; - -export default defineAppConfig({ - naiveui: { - themeConfig: { - shared: { - common: { - fontFamily: _fontFamily.sans.join(', '), - }, - }, - light: { - common: { - primaryColor: _colors.blue[600], - primaryColorHover: _colors.blue[500], - primaryColorPressed: _colors.blue[700], - }, - }, - dark: { - common: { - primaryColor: _colors.blue[500], - primaryColorHover: _colors.blue[400], - primaryColorPressed: _colors.blue[600], - }, - }, - }, - }, -}); +export default defineAppConfig({}); diff --git a/app.vue b/app.vue index 96199ba..f9b20d5 100644 --- a/app.vue +++ b/app.vue @@ -1,13 +1,7 @@ diff --git a/components/chat/ChatRow.vue b/components/chat/ChatRow.vue index a87e3a9..4dc9fac 100644 --- a/components/chat/ChatRow.vue +++ b/components/chat/ChatRow.vue @@ -1,15 +1,7 @@ @@ -21,5 +13,9 @@ defineProps({ type: Object as PropType, required: true, }, + selected: { + type: Boolean, + default: false, + }, }); diff --git a/components/chat/MessageSender.vue b/components/chat/MessageSender.vue index e469c00..500cc95 100644 --- a/components/chat/MessageSender.vue +++ b/components/chat/MessageSender.vue @@ -15,6 +15,8 @@ const props = defineProps({ }, }); +const logger = useLogger('chat::message-sender'); + const emit = defineEmits<{ (e: 'message', message: ChatMessageResponseDTO): void; (e: 'error', error: Error): void; @@ -29,7 +31,7 @@ const sendMessage = async () => { emit('message', newMess); message.value = ''; } catch (e) { - console.error(e); + logger.error(e); emit('error', e as Error); } }; diff --git a/components/layout/LeftSideContent.vue b/components/layout/LeftSideContent.vue index d261e9b..9e26fbe 100644 --- a/components/layout/LeftSideContent.vue +++ b/components/layout/LeftSideContent.vue @@ -1,16 +1,18 @@ diff --git a/components/layout/NavigationComponent.vue b/components/layout/NavigationComponent.vue index 707f795..e2f0950 100644 --- a/components/layout/NavigationComponent.vue +++ b/components/layout/NavigationComponent.vue @@ -1,16 +1,24 @@ + diff --git a/components/layout/RightSideContent.vue b/components/layout/RightSideContent.vue deleted file mode 100644 index 9d58dde..0000000 --- a/components/layout/RightSideContent.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/layouts/chat.vue b/layouts/chat.vue index 716379d..04a0015 100644 --- a/layouts/chat.vue +++ b/layouts/chat.vue @@ -1,38 +1,22 @@ - - diff --git a/layouts/default.vue b/layouts/default.vue index e10545a..21a30bb 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,18 +1,16 @@ - - diff --git a/layouts/plain.vue b/layouts/plain.vue index 40cd06d..2260c84 100644 --- a/layouts/plain.vue +++ b/layouts/plain.vue @@ -1,33 +1,18 @@ - - diff --git a/nuxt.config.ts b/nuxt.config.ts index 0e55ca4..466c2a4 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -19,7 +19,6 @@ export default defineNuxtConfig({ '@nuxtjs/eslint-module', '@nuxtjs/google-fonts', '@nuxt/image', - '@bg-dev/nuxt-naiveui', '@pinia/nuxt', '@pinia-plugin-persistedstate/nuxt', ], diff --git a/package.json b/package.json index d447fcc..ed3739b 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "web3": "^4.5.0" }, "devDependencies": { - "@bg-dev/nuxt-naiveui": "^1.10.2", "@commitlint/cli": "^18.6.1", "@nuxt/devtools": "^1.0.8", "@nuxt/image": "^1.3.0", diff --git a/pages/chat/index.vue b/pages/chat/index.vue index c23a32e..5deb69f 100644 --- a/pages/chat/index.vue +++ b/pages/chat/index.vue @@ -1,5 +1,7 @@ + diff --git a/components/layout/LeftSideContent.vue b/components/layout/LeftSideContent.vue index 9e26fbe..c23eb15 100644 --- a/components/layout/LeftSideContent.vue +++ b/components/layout/LeftSideContent.vue @@ -1,12 +1,12 @@