mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 08:45:38 +02:00
🐜 fix(www): Fix the marquee
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
|
import posthog from "posthog-js";
|
||||||
import Nestri from "@nestri/sdk";
|
import Nestri from "@nestri/sdk";
|
||||||
import { NavProgress } from "@nestri/ui";
|
import { NavProgress } from "@nestri/ui";
|
||||||
import { component$, Slot, useVisibleTask$ } from "@builder.io/qwik";
|
import { component$, Slot, useVisibleTask$ } from "@builder.io/qwik";
|
||||||
import { type DocumentHead, type RequestHandler } from "@builder.io/qwik-city";
|
import { type DocumentHead, type RequestHandler } from "@builder.io/qwik-city";
|
||||||
import posthog from "posthog-js";
|
|
||||||
|
|
||||||
export const onGet: RequestHandler = async ({ cacheControl }) => {
|
export const onGet: RequestHandler = async ({ cacheControl }) => {
|
||||||
// Control caching for this request for best performance and to reduce hosting costs:
|
// Control caching for this request for best performance and to reduce hosting costs:
|
||||||
@@ -15,18 +15,26 @@ export const onGet: RequestHandler = async ({ cacheControl }) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const onRequest: RequestHandler = async ({ cookie, sharedMap }) => {
|
export const onRequest: RequestHandler = async ({ cookie, url, redirect, sharedMap }) => {
|
||||||
const access = cookie.get("access_token")
|
const access = cookie.get("access_token")
|
||||||
if (access) {
|
if (access) {
|
||||||
const bearerToken = access.value
|
try {
|
||||||
|
|
||||||
const nestriClient = new Nestri({
|
const bearerToken = access.value
|
||||||
bearerToken,
|
|
||||||
baseURL: "https://api.nestri.io"
|
|
||||||
})
|
|
||||||
|
|
||||||
const currentProfile = await nestriClient.users.retrieve()
|
const nestriClient = new Nestri({
|
||||||
sharedMap.set("profile", currentProfile.data)
|
bearerToken,
|
||||||
|
baseURL: "https://api.nestri.io"
|
||||||
|
})
|
||||||
|
const currentProfile = await nestriClient.users.retrieve()
|
||||||
|
sharedMap.set("profile", currentProfile.data)
|
||||||
|
} catch (error) {
|
||||||
|
console.log("error working with bearer token", error)
|
||||||
|
cookie.delete("access_token")
|
||||||
|
cookie.delete("refresh_token")
|
||||||
|
|
||||||
|
throw redirect(302, url.origin)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ export const HomeNavBar = component$(({ avatarUrl, username, discriminator }: Pr
|
|||||||
value={team.name}
|
value={team.name}
|
||||||
class="leading-none text-sm items-center flex px-2 h-8 rounded-md outline-none relative select-none w-full"
|
class="leading-none text-sm items-center flex px-2 h-8 rounded-md outline-none relative select-none w-full"
|
||||||
>
|
>
|
||||||
<span class="w-full max-w-[20ch] flex items-center gap-2 truncate [&>svg]:size-5 ">
|
<span class="w-full max-w-[20ch] flex items-center gap-2 truncate [&>svg]:size-5 text-[#6f6f6f] dark:text-[#a0a0a0]">
|
||||||
<Avatar class="flex-shrink-0 rounded-full" name={team.name} />
|
<Avatar class="flex-shrink-0 rounded-full" name={team.name} />
|
||||||
{team.name}
|
{team.name}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ export const NavBar = component$(({ link }: Props) => {
|
|||||||
<button onClick$={() => window.location.href = link as string} class="w-full text-gray-900/70 bg-gray-400/30 dark:bg-gray-600/30 dark:text-gray-100/30 whitespace-nowrap font-mono text-sm py-3">
|
<button onClick$={() => window.location.href = link as string} class="w-full text-gray-900/70 bg-gray-400/30 dark:bg-gray-600/30 dark:text-gray-100/30 whitespace-nowrap font-mono text-sm py-3">
|
||||||
<div class="flex relative">
|
<div class="flex relative">
|
||||||
<span class="whitespace-pre marquee-animation">
|
<span class="whitespace-pre marquee-animation">
|
||||||
Launching Soon · Login to reserve your username · Launching Soon · Login to reserve your username · Launching Soon · Login to reserve your username ·
|
Launching Soon · Login to reserve your username · Launching Soon · Login to reserve your username · Launching Soon · Login to reserve your username · Launching Soon · Login to reserve your username ·
|
||||||
Launching Soon · Login to reserve your username · Launching Soon · Login to reserve your username · Launching Soon · Login to reserve your username ·
|
Launching Soon · Login to reserve your username · Launching Soon · Login to reserve your username · Launching Soon · Login to reserve your username · Launching Soon · Login to reserve your username ·
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user