feat: add dashboard button

This commit is contained in:
Jozef Steinhübl 2024-08-02 23:00:06 +02:00
parent 4a0388a2ba
commit 7adb5cc016
No known key found for this signature in database
GPG key ID: E6BC90C91973B08F
6 changed files with 74 additions and 16 deletions

View file

@ -0,0 +1,40 @@
<svg viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg" class="h-6 w-6"
><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g
id="SVGRepo_tracerCarrier"
stroke-linecap="round"
stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"
><path
fill="#CCD6DD"
d="M3 16v-2h30v2zm0 7v-2h30v2zm0 7v-2h30v2zM3 9V7h30v2z"></path><path
fill="#D5AB88"
d="M35 33V1a1 1 0 0 0-1-1h-1a1 1 0 0 0-1 1H4a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v32h34zM4 4h28v29H4V4z"
></path><path
fill="#3B94D9"
d="M19 5.5A1.5 1.5 0 0 0 17.5 7a1.5 1.5 0 1 0-3 0a1.5 1.5 0 1 0-3 0a1.5 1.5 0 1 0-3 0a1.5 1.5 0 1 0-3 0v2a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0V7A1.5 1.5 0 0 0 19 5.5z"
></path><path
fill="#BE1931"
d="M19 12.5a1.5 1.5 0 0 0-1.5 1.5a1.5 1.5 0 1 0-3 0a1.5 1.5 0 1 0-3 0a1.5 1.5 0 1 0-3 0a1.5 1.5 0 1 0-3 0v2a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0v-2a1.5 1.5 0 0 0-1.5-1.5z"
></path><path
fill="#5C913B"
d="M19 19.5a1.5 1.5 0 0 0-1.5 1.5a1.5 1.5 0 1 0-3 0a1.5 1.5 0 1 0-3 0a1.5 1.5 0 1 0-3 0a1.5 1.5 0 1 0-3 0v2a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0v-2a1.5 1.5 0 0 0-1.5-1.5z"
></path><path
fill="#FFAC33"
d="M19 26.5a1.5 1.5 0 0 0-1.5 1.5a1.5 1.5 0 1 0-3 0a1.5 1.5 0 1 0-3 0a1.5 1.5 0 1 0-3 0a1.5 1.5 0 1 0-3 0v2a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 3 0v-2a1.5 1.5 0 0 0-1.5-1.5z"
></path><path
fill="#3B94D9"
d="M29 10.5A1.5 1.5 0 0 1 27.5 9V7a1.5 1.5 0 1 1 3 0v2a1.5 1.5 0 0 1-1.5 1.5z"
></path><path
fill="#BE1931"
d="M29 17.5a1.5 1.5 0 0 1-1.5-1.5v-2a1.5 1.5 0 1 1 3 0v2a1.5 1.5 0 0 1-1.5 1.5z"
></path><path
fill="#5C913B"
d="M29 24.5a1.5 1.5 0 0 1-1.5-1.5v-2a1.5 1.5 0 0 1 3 0v2a1.5 1.5 0 0 1-1.5 1.5z"
></path><path
fill="#FFAC33"
d="M29 31.5a1.5 1.5 0 0 1-1.5-1.5v-2a1.5 1.5 0 0 1 3 0v2a1.5 1.5 0 0 1-1.5 1.5z"
></path><path
fill="#BF6952"
d="M35 33H1a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h34a1 1 0 0 0 1-1v-1a1 1 0 0 0-1-1z"
></path></g
></svg
>

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -1,5 +1,7 @@
--- ---
import Layout from "~/layouts/Layout.astro"; import Layout from "~/layouts/Layout.astro";
export const prerender = true;
--- ---
<Layout> <Layout>

View file

@ -1,5 +1,7 @@
--- ---
import Layout from "~/layouts/Layout.astro"; import Layout from "~/layouts/Layout.astro";
export const prerender = true;
--- ---
<Layout> <Layout>

View file

@ -2,7 +2,9 @@
import { getSession } from "auth-astro/server"; import { getSession } from "auth-astro/server";
const session = await getSession(Astro.request); const session = await getSession(Astro.request);
console.log(session); if (!session) {
return Astro.redirect("/auth/login");
}
--- ---
{session ? <p>Welcome {session.user?.name}</p> : <p>Not logged in</p>} <p>Welcome {session.user?.name}</p>

View file

@ -2,8 +2,11 @@
import Layout from "~/layouts/Layout.astro"; import Layout from "~/layouts/Layout.astro";
import Invite from "~/components/Invite.astro"; import Invite from "~/components/Invite.astro";
import Computer from "~/components/Computer.astro"; import Computer from "~/components/Computer.astro";
import Settings from "~/components/Settings.astro";
import Logo from "~/assets/logo.png"; import Logo from "~/assets/logo.png";
import { Image } from "astro:assets"; import { Image } from "astro:assets";
export const prerender = true;
--- ---
<Layout> <Layout>
@ -32,15 +35,22 @@ import { Image } from "astro:assets";
<div class="mt-6 flex flex-col gap-6 md:flex-row"> <div class="mt-6 flex flex-col gap-6 md:flex-row">
<a <a
href="https://discord.com/api/oauth2/authorize?client_id=923267906941370368&permissions=268435456&scope=bot%20applications.commands" href="https://discord.com/api/oauth2/authorize?client_id=923267906941370368&permissions=268435456&scope=bot%20applications.commands"
class="broder-1 duration-400 flex items-center justify-center gap-x-3 rounded-lg border border-[#5865F2] bg-[#5865F2]/25 px-10 py-3 text-lg font-semibold text-white shadow-2xl shadow-[#5865F2]/25 transition-colors ease-out hover:bg-[#5865F2]/40 hover:shadow-[#5865F2]/30" class="broder-1 duration-400 flex items-center justify-center gap-x-3 rounded-lg border border-blue bg-blue/25 px-10 py-3 text-lg font-semibold text-white shadow-2xl shadow-blue/25 transition-colors ease-out hover:bg-blue/40 hover:shadow-blue/30"
target="_blank" target="_blank"
> >
<Invite /> <Invite />
Add to Discord</a Add to Discord</a
> >
<a
href="/dashboard"
class="broder-1 duration-400 flex items-center justify-center gap-x-3 rounded-lg border border-gold bg-gold/25 px-10 py-3 text-lg font-semibold text-white shadow-2xl shadow-gold/25 transition-colors ease-out hover:bg-gold/40 hover:shadow-gold/30"
>
<Settings />
Dashboard</a
>
<a <a
href="https://github.com/xHyroM/roles-bot" href="https://github.com/xHyroM/roles-bot"
class="broder-1 duration-400 flex items-center justify-center gap-x-3 rounded-lg border border-[#FFA500] bg-[#FFA500]/25 px-10 py-3 text-lg font-semibold text-white shadow-2xl shadow-[#FFA500]/25 transition-colors ease-out hover:bg-[#FFA500]/40 hover:shadow-[#FFA500]/30" class="broder-1 duration-400 flex items-center justify-center gap-x-3 rounded-lg border border-gray-50 bg-gray-50/25 px-10 py-3 text-lg font-semibold text-white shadow-2xl shadow-gray-50/25 transition-colors ease-out hover:bg-gray-50/40 hover:shadow-gray-50/30"
target="_blank" target="_blank"
> >
<Computer /> <Computer />

View file

@ -5,6 +5,8 @@ module.exports = {
extend: { extend: {
colors: { colors: {
dark: "#111111", dark: "#111111",
blue: "#5865F2",
gold: "#FFA500",
}, },
fontFamily: { fontFamily: {
body: ["Montserrat", "sans-serif"], body: ["Montserrat", "sans-serif"],