diff --git a/src/app/me/aniamtedLink.module.tsx b/src/app/me/aniamtedLink.module.tsx new file mode 100644 index 0000000..0414d37 --- /dev/null +++ b/src/app/me/aniamtedLink.module.tsx @@ -0,0 +1,37 @@ +"use client"; +import Link, { LinkProps } from "next/link"; +import React, { ReactNode } from "react"; +import { useRouter } from "next/navigation"; + +interface AnimatedLinkProps + extends Omit, "href">, + LinkProps { + children: ReactNode; + href: string; + delay?: number; +} + +function sleep(ms: number): Promise { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +export const TransitionLink: React.FC = ({ children, href, ...props }) => { + const router = useRouter(); + const handleTransition = async (e: React.MouseEvent) => { + e.preventDefault(); + const body = document.getElementById("sidebar"); + if (body) { + body.style.transform = 'translateY(50px)'; + body.style.opacity = '0'; + } + + await sleep(200); + router.push(href); + }; + + return ( + + {children} + + ); +}; \ No newline at end of file diff --git a/src/app/me/notifications/page.tsx b/src/app/me/notifications/page.tsx index 0e56b75..7d554c6 100644 --- a/src/app/me/notifications/page.tsx +++ b/src/app/me/notifications/page.tsx @@ -74,7 +74,7 @@ const Notifications = () => {
-
+
); diff --git a/src/app/styles/header.module.css b/src/app/styles/header.module.css index 721621c..48dac39 100644 --- a/src/app/styles/header.module.css +++ b/src/app/styles/header.module.css @@ -78,7 +78,7 @@ background-color: var(--main-menu-color); box-shadow: none; transform: scale(1); - transition: background-color 150ms, box-shadow 150ms; + transition: background-color 200ms, box-shadow 200ms, transform 200ms; cursor: pointer; color: var(--main-text-color); diff --git a/src/app/workshop/[id]/client_code.tsx b/src/app/workshop/[id]/client_code.tsx index 0c5de90..570f386 100644 --- a/src/app/workshop/[id]/client_code.tsx +++ b/src/app/workshop/[id]/client_code.tsx @@ -507,11 +507,10 @@ const EditElement = ({ bandage, onClose }: { bandage: Interfaces.Bandage, onClos return string.charAt(0).toUpperCase() + string.slice(1); } - const save = () => { authApi.put(`workshop/${bandage.external_id}`, { title: title, - description: description !== "" ? description : null, + description: description || null, categories: categories, access_level: accessLevel }).then((response) => { @@ -546,7 +545,7 @@ const EditElement = ({ bandage, onClose }: { bandage: Interfaces.Bandage, onClos className={`react-select-container`} classNamePrefix="react-select" isSearchable={false} - onChange={(n, a) => setAccessLevel(n.value)} + onChange={(n, _) => setAccessLevel(n.value)} />