Gate Obsidian Toolbox behind TOOLBOX_VISIBLE flag
Toolbox is still being refined; hide it from clients on prod while keeping it usable on staging. Entry points (header link, dashboard card) render only when TOOLBOX_VISIBLE=true; a tools/layout redirects /tools/* to /dashboard otherwise. Routes and ToolUsage table are untouched (no destructive migration). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,3 +41,7 @@ LISTMONK_QUIZ_LIST_ID=""
|
|||||||
# Freemium gate: ID wow-урока (2.6 «ежедневные заметки») — после его завершения
|
# Freemium gate: ID wow-урока (2.6 «ежедневные заметки») — после его завершения
|
||||||
# показываем лестницу-оффер (трипвайр + полный курс)
|
# показываем лестницу-оффер (трипвайр + полный курс)
|
||||||
WOW_MOMENT_LESSON_ID="obs-start-l2-006"
|
WOW_MOMENT_LESSON_ID="obs-start-l2-006"
|
||||||
|
|
||||||
|
# Obsidian Toolbox (/tools): "true" — показывать точки входа и роуты (staging);
|
||||||
|
# не задано/иное — скрыто, /tools редиректит на /dashboard (prod, пока дорабатываем)
|
||||||
|
TOOLBOX_VISIBLE=""
|
||||||
|
|||||||
@@ -168,9 +168,11 @@ export default async function StudentDashboard() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{process.env.TOOLBOX_VISIBLE === "true" && (
|
||||||
<div className="mt-8">
|
<div className="mt-8">
|
||||||
<ToolboxPromoCard />
|
<ToolboxPromoCard />
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{locked.length > 0 && (
|
{locked.length > 0 && (
|
||||||
<div className="mt-10">
|
<div className="mt-10">
|
||||||
|
|||||||
@@ -57,9 +57,11 @@ export default async function StudentLayout({ children }: { children: React.Reac
|
|||||||
<Link href="/wrapped" className="text-sm hover:underline" style={{ color: "var(--muted-foreground)" }}>
|
<Link href="/wrapped" className="text-sm hover:underline" style={{ color: "var(--muted-foreground)" }}>
|
||||||
Wrapped
|
Wrapped
|
||||||
</Link>
|
</Link>
|
||||||
|
{process.env.TOOLBOX_VISIBLE === "true" && (
|
||||||
<Link href="/tools" className="text-sm hover:underline" style={{ color: "var(--muted-foreground)" }}>
|
<Link href="/tools" className="text-sm hover:underline" style={{ color: "var(--muted-foreground)" }}>
|
||||||
Инструменты
|
Инструменты
|
||||||
</Link>
|
</Link>
|
||||||
|
)}
|
||||||
<Link href="/questions" className="text-sm hover:underline" style={{ color: "var(--muted-foreground)" }}>
|
<Link href="/questions" className="text-sm hover:underline" style={{ color: "var(--muted-foreground)" }}>
|
||||||
Вопросы
|
Вопросы
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { redirect } from "next/navigation";
|
||||||
|
|
||||||
|
// Toolbox ещё в доработке: на проде скрыт (флаг не задан) — прямой заход на
|
||||||
|
// /tools/* уводит на дашборд. На staging выставлен TOOLBOX_VISIBLE=true.
|
||||||
|
export default function ToolsLayout({ children }: { children: React.ReactNode }) {
|
||||||
|
if (process.env.TOOLBOX_VISIBLE !== "true") redirect("/dashboard");
|
||||||
|
return <>{children}</>;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user