From edcc3efe1d971923215a5946e9d76fea168413af Mon Sep 17 00:00:00 2001 From: dragongoose <19649813+dragongoose@users.noreply.github.com> Date: Fri, 24 Mar 2023 18:48:45 -0400 Subject: [PATCH] Fix frontend for seperate backend, and make preferences page --- .env | 2 + env.d.ts | 10 ++++ package.json | 3 +- src/components/ErrorMessage.vue | 40 +++++++++++++ src/components/TwitchChat.vue | 4 +- src/router/index.ts | 7 ++- src/views/CategoryView.vue | 102 +++++++++++++++++--------------- src/views/HomepageView.vue | 49 ++++++++------- src/views/PreferencesView.vue | 69 +++++++++++++++++++++ src/views/UserView.vue | 40 ++++--------- tailwind.config.js | 5 +- 11 files changed, 230 insertions(+), 101 deletions(-) create mode 100644 .env create mode 100644 src/components/ErrorMessage.vue create mode 100644 src/views/PreferencesView.vue diff --git a/.env b/.env new file mode 100644 index 0000000..694ad76 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +VITE_BACKEND_URL=http://localhost:7000 +VITE_INSTANCE_URL=http://localhost:5173 \ No newline at end of file diff --git a/env.d.ts b/env.d.ts index 11f02fe..5a8edb6 100644 --- a/env.d.ts +++ b/env.d.ts @@ -1 +1,11 @@ /// + +interface ImportMetaEnv { + readonly VITE_BACKEND_URL: string + readonly VITE_INSTANCE_URL: string + // more env variables... + } + + interface ImportMeta { + readonly env: ImportMetaEnv + } \ No newline at end of file diff --git a/package.json b/package.json index 9d61b64..4a24e1d 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ }, "dependencies": { "@dragongoose/streamlink": "^1.0.2", + "@tailwindcss/forms": "^0.5.3", "oh-vue-icons": "^1.0.0-rc3", "video.js": "^8.0.4", "videojs-contrib-quality-levels": "^3.0.0", @@ -25,9 +26,9 @@ "@rushstack/eslint-patch": "^1.2.0", "@tailwindcss/typography": "^0.5.9", "@types/node": "^18.14.2", + "@types/video.js": "^7.3.51", "@types/videojs-contrib-quality-levels": "^2.0.1", "@types/videojs-hls-quality-selector": "^1.1.0", - "@types/video.js": "^7.3.51", "@vitejs/plugin-vue": "^4.0.0", "@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-typescript": "^11.0.2", diff --git a/src/components/ErrorMessage.vue b/src/components/ErrorMessage.vue new file mode 100644 index 0000000..c68167e --- /dev/null +++ b/src/components/ErrorMessage.vue @@ -0,0 +1,40 @@ + + + diff --git a/src/components/TwitchChat.vue b/src/components/TwitchChat.vue index 4742c4f..15e354f 100644 --- a/src/components/TwitchChat.vue +++ b/src/components/TwitchChat.vue @@ -57,7 +57,9 @@ export default {