✏️ Add icon in title

This commit is contained in:
SebClem 2022-06-12 12:51:05 +02:00
parent 82b2148d86
commit d90a34435f
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50
8 changed files with 15 additions and 3 deletions

View File

@ -1,4 +1,6 @@
VITE_OAUTH_REDIRECT_URL="https://discord.com/api/oauth2/authorize?client_id=238351507634913280&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Foauth2%2Fcallback&response_type=code&scope=identify"
VITE_API_BASE_URL="http://localhost:8080/api/v2/"
VITE_DISCORD_USER_AVATAR_URL="https://cdn.discordapp.com/avatars/"
VITE_DISCORD_USER_AVATAR_URL="https://cdn.discordapp.com/avatars/"
VITE_APP_TITLE="Claptrap DEV"

1
env.d.ts vendored
View File

@ -3,6 +3,7 @@ interface ImportMetaEnv {
readonly VITE_OAUTH_REDIRECT_URL: string;
readonly VITE_API_BASE_URL: string;
readonly VITE_DISCORD_USER_AVATAR_URL: string;
readonly VITE_APP_TITLE: string;
// more env variables...
}

View File

@ -5,7 +5,7 @@
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vuetify 3 Vite Preview</title>
<title>Claptrap Bot</title>
</head>
<body>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 15 KiB

BIN
public/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

View File

@ -1,7 +1,10 @@
<template>
<v-app-bar class="bg-brown-darken-4">
<v-app-bar-title class="text-yellow font-weight-black text-h4">
Claptrap Bot
<div class="d-flex align-center">
<v-avatar><v-img src="/icon.png"></v-img></v-avatar>
<span class="ml-3">Claptrap Bot</span>
</div>
</v-app-bar-title>
</v-app-bar>
<v-navigation-drawer expand-on-hover rail position="right" v-if="isLoggedIn">

View File

@ -11,6 +11,7 @@ import HomeView from "../views/HomeView.vue";
declare module "vue-router" {
interface RouteMeta {
requiresAuth: boolean;
title: string;
}
}
@ -23,6 +24,7 @@ const router = createRouter({
component: HomeView,
meta: {
requiresAuth: false,
title: "Home",
},
},
{
@ -31,6 +33,7 @@ const router = createRouter({
component: GuildHomeViewVue,
meta: {
requiresAuth: true,
title: "Home",
},
},
{
@ -39,6 +42,7 @@ const router = createRouter({
component: OauthCallbackViewVue,
meta: {
requiresAuth: false,
title: "Login",
},
},
{
@ -47,6 +51,7 @@ const router = createRouter({
component: OauthRedirectViewVue,
meta: {
requiresAuth: false,
title: "Login",
},
},
],
@ -54,6 +59,7 @@ const router = createRouter({
router.beforeEach((to, from) => {
const store = useUserStore();
document.title = `${import.meta.env.VITE_APP_TITLE} - ${to.meta.title}`;
if (to.meta.requiresAuth && !store.isLoggedIn) {
return { name: "oauth-redirect" };
} else {