From 955fed547c2f5a82c29d31f3b7a6ba945409a169 Mon Sep 17 00:00:00 2001 From: NeonXP Date: Sun, 21 Jan 2024 02:29:41 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BC=D0=B0=D0=BD=D0=B8=D1=84=D0=B5=D1=81=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Layout.jsx | 30 ++++++++++++++++-------------- frontend/vite.config.js | 4 ++-- main.go | 2 ++ 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/Layout.jsx b/frontend/src/components/Layout.jsx index 9279613..b6ace7e 100644 --- a/frontend/src/components/Layout.jsx +++ b/frontend/src/components/Layout.jsx @@ -35,20 +35,6 @@ const AppLayout = () => { label: 'Квесты', link: '/quests' }, - hasRole('creator') - ? { - key: 'quest/new', - label: 'Создать квест', - link: '/quest/new' - } - : null, - hasRole('admin') - ? { - key: 'admin', - label: 'Админка', - link: '/admin' - } - : null, { key: 'me', label: `${user.username} [${user.level}]`, @@ -60,6 +46,22 @@ const AppLayout = () => { onClick: logout } ] + + if (hasRole('creator')) { + items.push({ + key: 'quest/new', + label: 'Создать квест', + link: '/quest/new' + }) + } + + if (hasRole('admin')) { + items.push({ + key: 'admin', + label: 'Админка', + link: '/admin' + }) + } } const menuHandler = (x) => { const item = items.find(y => y.key === x.key) diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 58bae82..44d960d 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -53,9 +53,9 @@ const manifest = { ], theme_color: '#fb923c', background_color: '#171e26', - display: 'standalone', + display: 'minimal-ui', scope: '/', - start_url: '/quests' + start_url: '/' } } diff --git a/main.go b/main.go index db83bf2..4fb4ecb 100644 --- a/main.go +++ b/main.go @@ -99,8 +99,10 @@ func main() { } } } + return echo.ErrForbidden } + return nil }