feat: restructure routing and layouts for admin and news sections, update cookie paths
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user