Explorar o código

client/web: disable the "disable" button when disabled

We currently disable the exit-node drop down selector when the user is
in read-only mode, but we missed disabling the "Disable" button also.
Previously, it would display an error when clicked.

Updates tailscale/corp#14335

Signed-off-by: Will Norris <[email protected]>
Will Norris %!s(int64=2) %!d(string=hai) anos
pai
achega
03e780e9af
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      client/web/src/components/exit-node-selector.tsx

+ 3 - 1
client/web/src/components/exit-node-selector.tsx

@@ -115,15 +115,17 @@ export default function ExitNodeSelector({
         </button>
         </button>
         {(advertising || using) && (
         {(advertising || using) && (
           <button
           <button
-            className={cx("px-3 py-2 rounded-sm text-white cursor-pointer", {
+            className={cx("px-3 py-2 rounded-sm text-white", {
               "bg-orange-400": advertising,
               "bg-orange-400": advertising,
               "bg-indigo-400": using,
               "bg-indigo-400": using,
+              "cursor-not-allowed": disabled,
             })}
             })}
             onClick={(e) => {
             onClick={(e) => {
               e.preventDefault()
               e.preventDefault()
               e.stopPropagation()
               e.stopPropagation()
               handleSelect(noExitNode)
               handleSelect(noExitNode)
             }}
             }}
+            disabled={disabled}
           >
           >
             Disable
             Disable
           </button>
           </button>