[fix] solution/frontend: 로그인하면 랜딩·요금에 갈 길이 없던 것

/ 가 로그인 상태면 /sites 로 튕겼다. 그래서 로그인한 사장님은 랜딩도 요금도 볼 수 없었다 —
로고를 눌러도 목록으로 되돌아온다. 앱 사이드바에도 요금 링크가 한 곳도 없었다.

- / 는 로그인 여부와 무관하게 랜딩이다. 로그인 상태는 헤더가 말한다([로그인] 대신 [내 사이트])
- AppShell 사이드바에 [요금] 추가
This commit is contained in:
Mina Choi 2026-09-04 16:48:03 +09:00
parent a1d8a2e943
commit ee284ba7a6
2 changed files with 10 additions and 29 deletions

View File

@ -1,5 +1,4 @@
import {createBrowserRouter, Navigate} from 'react-router';
import {Loader2} from 'lucide-react';
import {createBrowserRouter} from 'react-router';
import {AccountPage} from '@/pages/AccountPage';
import {BuilderPage} from '@/pages/BuilderPage';
import {DevShowcasePage} from '@/pages/DevShowcasePage';
@ -11,38 +10,18 @@ import {ShowcasePage} from '@/pages/ShowcasePage';
import {SignupPage} from '@/pages/SignupPage';
import {SitesPage} from '@/pages/SitesPage';
import {RequireAuth} from '@/components/layout/RequireAuth';
import {useAuthStore} from '@/stores/auth';
/**
* "새로 만들기"
* "내 것 고치기". **** .
*
* .
* .
* .
*/
function Home() {
const isRestoring = useAuthStore((s) => s.isRestoring);
const user = useAuthStore((s) => s.user);
if (isRestoring) {
return (
<div className="flex h-screen items-center justify-center text-muted-foreground">
<Loader2 className="size-5 animate-spin" />
</div>
);
}
if (user) return <Navigate to="/sites" replace />;
return <LandingPage />;
}
export const router = createBrowserRouter([
{path: '/login', element: <LoginPage />},
// 로그인 화면의 [회원가입] 이 여기로 온다. 이 줄이 없으면 링크는 있고 목적지만 404 다.
{path: '/signup', element: <SignupPage />},
// 비로그인 = 랜딩, 로그인 = 내 사이트. Home 이 그걸 가른다.
{path: '/', element: <Home />},
/**
* . /sites ,
* · ** ** .
* (MarketingShell [] [ ] ).
*/
{path: '/', element: <LandingPage />},
// 로그인 전 화면. ★ 랜딩과 같은 껍데기(MarketingShell)를 쓴다 — 사이드바 없는 문서형이다.
{path: '/pricing', element: <PricingPage />},

View File

@ -1,6 +1,6 @@
import type {ComponentType, ReactNode} from 'react';
import {Link, NavLink, useLocation, useNavigate} from 'react-router';
import {LayoutGrid, LogIn, LogOut, Search, Store, Wand2} from 'lucide-react';
import {LayoutGrid, LogIn, LogOut, Receipt, Search, Store, Wand2} from 'lucide-react';
import {cn} from '@/lib/utils';
import {userLabel, useAuthStore} from '@/stores/auth';
@ -25,6 +25,8 @@ export type NavItem = {
const OWNER_NAV: NavItem[] = [
{to: '/sites', match: '/sites', label: '내 사이트', icon: Store},
{to: '/builder?new=1', match: '/builder', label: '새 사이트', icon: Wand2},
// ★ 앱 안에서 요금으로 갈 길이 한 곳도 없었다 — 로그인하면 랜딩 헤더를 못 보기 때문이다.
{to: '/pricing', match: '/pricing', label: '요금', icon: Receipt},
];
export function AppShell({children, nav = OWNER_NAV}: {children: ReactNode; nav?: NavItem[]}) {