From 0a406ac071bfe74359190c5c43de0278aa215783 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 10 Nov 2018 13:49:54 +0200 Subject: [PATCH] Change more things --- .../management/frontend/src/pages/dashboard/Client.js | 10 ++++++++-- .../management/frontend/src/style/base/elements.sass | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/maubot/management/frontend/src/pages/dashboard/Client.js b/maubot/management/frontend/src/pages/dashboard/Client.js index ef414a0..f6d9ed9 100644 --- a/maubot/management/frontend/src/pages/dashboard/Client.js +++ b/maubot/management/frontend/src/pages/dashboard/Client.js @@ -222,10 +222,16 @@ class Client extends Component { ) + get hasInstances() { + return this.state.instances.length > 0 + } + renderPrefButtons = () => <>
{!this.isNew && ( - )} @@ -238,7 +244,7 @@ class Client extends Component { renderInstances = () => !this.isNew && (
-

{this.state.instances.length > 0 ? "Instances" : "No instances :("}

+

{this.hasInstances ? "Instances" : "No instances :("}

{this.state.instances.map(instance => ( {instance.id} diff --git a/maubot/management/frontend/src/style/base/elements.sass b/maubot/management/frontend/src/style/base/elements.sass index 99a6e5e..91a20c2 100644 --- a/maubot/management/frontend/src/style/base/elements.sass +++ b/maubot/management/frontend/src/style/base/elements.sass @@ -26,6 +26,9 @@ box-sizing: border-box font-size: 1rem + &.disabled-bg + background-color: $background-dark + &:not(:disabled) cursor: pointer