diff --git a/.env.example b/.env.example index c940c30..71c35ab 100644 --- a/.env.example +++ b/.env.example @@ -41,3 +41,7 @@ LISTMONK_QUIZ_LIST_ID="" # Freemium gate: ID wow-урока (2.6 «ежедневные заметки») — после его завершения # показываем лестницу-оффер (трипвайр + полный курс) WOW_MOMENT_LESSON_ID="obs-start-l2-006" + +# Obsidian Toolbox (/tools): "true" — показывать точки входа и роуты (staging); +# не задано/иное — скрыто, /tools редиректит на /dashboard (prod, пока дорабатываем) +TOOLBOX_VISIBLE="" diff --git a/src/app/(student)/dashboard/page.tsx b/src/app/(student)/dashboard/page.tsx index 527ecf6..e010757 100644 --- a/src/app/(student)/dashboard/page.tsx +++ b/src/app/(student)/dashboard/page.tsx @@ -168,9 +168,11 @@ export default async function StudentDashboard() { )} -
- -
+ {process.env.TOOLBOX_VISIBLE === "true" && ( +
+ +
+ )} {locked.length > 0 && (
diff --git a/src/app/(student)/layout.tsx b/src/app/(student)/layout.tsx index 1ae9dfc..2c4f27c 100644 --- a/src/app/(student)/layout.tsx +++ b/src/app/(student)/layout.tsx @@ -57,9 +57,11 @@ export default async function StudentLayout({ children }: { children: React.Reac Wrapped - - Инструменты - + {process.env.TOOLBOX_VISIBLE === "true" && ( + + Инструменты + + )} Вопросы diff --git a/src/app/(student)/tools/layout.tsx b/src/app/(student)/tools/layout.tsx new file mode 100644 index 0000000..8da8414 --- /dev/null +++ b/src/app/(student)/tools/layout.tsx @@ -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}; +}