From 078a5b2580fd0d6ccf6f6070f34d900a45eb09f5 Mon Sep 17 00:00:00 2001 From: Nikita Date: Wed, 17 Apr 2024 20:08:04 +0200 Subject: [PATCH] chore: code structure improved --- app/(auth)/auth/callback/oauth/route.ts | 1 + .../support/tickets/components/DesktopSidebarTicket.tsx | 8 +++++--- app/components/Navbar/components/LogoutDropdownItem.tsx | 1 + app/globals.css | 8 +++++++- app/hooks/ui/supportButton/useActiveTab.ts | 1 + 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/(auth)/auth/callback/oauth/route.ts b/app/(auth)/auth/callback/oauth/route.ts index e7b53619..54470743 100644 --- a/app/(auth)/auth/callback/oauth/route.ts +++ b/app/(auth)/auth/callback/oauth/route.ts @@ -44,6 +44,7 @@ export async function GET(request: Request) { avatar_url: avatarUrl, providers: [provider!], }) + // If row already exist - do 4 and 5 if (is_row_exist) { // 4. If provider_response !=== provider - add one more provider diff --git a/app/(support)/support/tickets/components/DesktopSidebarTicket.tsx b/app/(support)/support/tickets/components/DesktopSidebarTicket.tsx index b3606554..eb6b828e 100644 --- a/app/(support)/support/tickets/components/DesktopSidebarTicket.tsx +++ b/app/(support)/support/tickets/components/DesktopSidebarTicket.tsx @@ -1,10 +1,12 @@ "use client" + +import Link from "next/link" +import Image from "next/image" +import { twMerge } from "tailwind-merge" + import useTicket from "@/hooks/support/useTicket" import useSender from "@/hooks/ui/useSender" import { ITicket } from "@/interfaces/support/ITicket" -import Image from "next/image" -import Link from "next/link" -import { twMerge } from "tailwind-merge" interface DesktopSidebarTicketProps { ticket: ITicket diff --git a/app/components/Navbar/components/LogoutDropdownItem.tsx b/app/components/Navbar/components/LogoutDropdownItem.tsx index 4e7f6ad8..a58f6a6d 100644 --- a/app/components/Navbar/components/LogoutDropdownItem.tsx +++ b/app/components/Navbar/components/LogoutDropdownItem.tsx @@ -17,5 +17,6 @@ export default function LogoutDropdownItem() { userStore.logoutUser() router.refresh() } + return } diff --git a/app/globals.css b/app/globals.css index e3c1249a..fafe8959 100644 --- a/app/globals.css +++ b/app/globals.css @@ -96,7 +96,13 @@ body { } .image-upload { - /* https://kovart.github.io/dashed-border-generator/ */ + /* +Docs - https://kovart.github.io/dashed-border-generator/ +stroke='%230E00FF' - correct +stroke='%0E00FF' - not correcrt +stroke='0E00FF' - not correcrt +So just add your HEX after %23 +*/ background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='%23FE0E00FF' stroke-width='4' stroke-dasharray='9%25%2c 10%25' stroke-dashoffset='6' stroke-linecap='butt'/%3e%3c/svg%3e"); } diff --git a/app/hooks/ui/supportButton/useActiveTab.ts b/app/hooks/ui/supportButton/useActiveTab.ts index 94f6d156..ba67af9c 100644 --- a/app/hooks/ui/supportButton/useActiveTab.ts +++ b/app/hooks/ui/supportButton/useActiveTab.ts @@ -3,6 +3,7 @@ import { useEffect, useRef, useState } from "react" export const useIsActiveTab = () => { const isActiveRef = useRef(document.visibilityState === "visible" && document.hasFocus()) const [trigger, setTrigger] = useState(false) // Used only to trigger re-renders + // don't remove line above because it will not work as expected // Function to update the isActive state const updateIsActiveState = (isActive: boolean) => {