From 12109245623a3e086370b84b03d80be66c022309 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Fri, 29 Jan 2021 13:06:36 +0100 Subject: [PATCH] :bug: Hide demo user link on login and register when is disabled. --- frontend/src/app/main/ui/auth/login.cljs | 13 +++++++------ frontend/src/app/main/ui/auth/register.cljs | 12 +++++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/frontend/src/app/main/ui/auth/login.cljs b/frontend/src/app/main/ui/auth/login.cljs index 21ec5c64d..ecfa02344 100644 --- a/frontend/src/app/main/ui/auth/login.cljs +++ b/frontend/src/app/main/ui/auth/login.cljs @@ -152,9 +152,10 @@ {:src "/images/icons/brand-github.svg"}] (tr "auth.login-with-github-submit")]) - [:div.links.demo - [:div.link-entry - [:span (tr "auth.create-demo-profile") " "] - [:a {:on-click (st/emitf da/create-demo-profile) - :tab-index "6"} - (tr "auth.create-demo-account")]]]]]) + (when cfg/allow-demo-users + [:div.links.demo + [:div.link-entry + [:span (tr "auth.create-demo-profile") " "] + [:a {:on-click (st/emitf da/create-demo-profile) + :tab-index "6"} + (tr "auth.create-demo-account")]]])]]) diff --git a/frontend/src/app/main/ui/auth/register.cljs b/frontend/src/app/main/ui/auth/register.cljs index 756cd3b5b..762db59cc 100644 --- a/frontend/src/app/main/ui/auth/register.cljs +++ b/frontend/src/app/main/ui/auth/register.cljs @@ -116,6 +116,7 @@ [:div.form-container [:h1 (t locale "auth.register-title")] [:div.subtitle (t locale "auth.register-subtitle")] + (when cfg/demo-warning [:& demo-warning]) @@ -129,8 +130,9 @@ :tab-index "4"} (t locale "auth.login-here")]] - [:div.link-entry - [:span (t locale "auth.create-demo-profile") " "] - [:a {:on-click #(st/emit! da/create-demo-profile) - :tab-index "5"} - (t locale "auth.create-demo-account")]]]]) \ No newline at end of file + (when cfg/allow-demo-users + [:div.link-entry + [:span (t locale "auth.create-demo-profile") " "] + [:a {:on-click #(st/emit! da/create-demo-profile) + :tab-index "5"} + (t locale "auth.create-demo-account")]])]])