/
githubmirror
/
strapi
Обзор
Документация
Войти
/
githubmirror
/
strapi
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/plugins/cloud/admin/src/pages/App.tsx
30 строк
708 B
Ben Irvin
fix(cloud): hide deploy menu in production using currentEnvironment (#26733)
02 июл 2026, 13:16
Не верифицирован
02 июл 2026, 13:16
f2c81ee
Код
Авторство
О чём код?
/** * * This component is the skeleton around the actual pages, and should only * contain code that should be seen on all pages. (e.g. navigation bar) * */ import { Page, useAppInfo } from '@strapi/strapi/admin'; import { Navigate, Routes, Route } from 'react-router-dom'; import { HomePage } from './HomePage'; const App = () => { const currentEnvironment = useAppInfo('CloudApp', (state) => state.currentEnvironment); if (currentEnvironment === 'production') { return <Navigate to="/" replace />; } return ( <div> <Routes> <Route index element={<HomePage />} /> <Route path="*" element={<Page.Error />} /> </Routes> </div> ); }; export { App };