feat: restructure routing and layouts for admin and news sections, update cookie paths

This commit is contained in:
Ardeman
2025-02-28 11:49:51 +08:00
parent 4b8fc0721e
commit 23e3493a3f
30 changed files with 55 additions and 64 deletions
+4 -4
View File
@@ -3,17 +3,17 @@ import { Link, useFetcher, useRouteLoaderData } from 'react-router'
import { Button } from '~/components/ui/button'
import { APP } from '~/configs/meta'
import { useNewsContext } from '~/contexts/news'
import type { loader } from '~/routes/_layout.news'
import type { loader } from '~/routes/_layout'
export const HeaderTop = () => {
const { setIsLoginOpen } = useNewsContext()
const loaderData = useRouteLoaderData<typeof loader>('routes/_layout.news')
const loaderData = useRouteLoaderData<typeof loader>('routes/_layout')
const fetcher = useFetcher()
return (
<div className="flex h-[60px] items-center justify-between bg-white px-5 align-middle sm:h-[100px] sm:gap-[15px] sm:px-[50px] sm:py-[20px]">
<Link
to="/news"
to="/"
className="mt-2 h-full py-2"
>
<img
@@ -32,7 +32,7 @@ export const HeaderTop = () => {
{loaderData?.userToken ? (
<fetcher.Form
method="POST"
action="/actions/news/logout"
action="/actions/logout"
>
<Button
variant="newsSecondary"