From 487173dc04f08e3aa90f08e4336e27ab080a1944 Mon Sep 17 00:00:00 2001 From: chh <1474479+chenhunghan@users.noreply.github.com> Date: Tue, 10 Aug 2021 16:33:38 +0300 Subject: [PATCH] Add background-color, box-shadow and padding to .ClusterStatus (#3582) --- .../cluster-manager/cluster-status.module.css | 39 +++++++++++++ .../cluster-manager/cluster-status.scss | 55 ------------------- .../cluster-manager/cluster-status.tsx | 20 +++---- 3 files changed, 49 insertions(+), 65 deletions(-) create mode 100644 src/renderer/components/cluster-manager/cluster-status.module.css delete mode 100644 src/renderer/components/cluster-manager/cluster-status.scss diff --git a/src/renderer/components/cluster-manager/cluster-status.module.css b/src/renderer/components/cluster-manager/cluster-status.module.css new file mode 100644 index 0000000000..194ef467db --- /dev/null +++ b/src/renderer/components/cluster-manager/cluster-status.module.css @@ -0,0 +1,39 @@ +.status { + --flex-gap: 16px; + + position: relative; + min-width: 350px; + margin: auto; + text-align: center; + z-index: 1; + background: var(--mainBackground); + width: 100%; + height: 100%; + + pre { + max-width: 70vw; + max-height: 40vh; + white-space: pre-line; + overflow: auto; + line-height: 1.7; + + p { + margin-bottom: var(--margin); + } + } + + a { + cursor: pointer; + } +} + +.spinner { + --spinner-size: 38px; + --spinner-border: calc(var(--spinner-size) / 10); +} + +.icon { + --size: 70px; + margin: auto; + color: var(--colorError); +} \ No newline at end of file diff --git a/src/renderer/components/cluster-manager/cluster-status.scss b/src/renderer/components/cluster-manager/cluster-status.scss deleted file mode 100644 index 77d6e7693f..0000000000 --- a/src/renderer/components/cluster-manager/cluster-status.scss +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Copyright (c) 2021 OpenLens Authors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -.ClusterStatus { - --flex-gap: #{$padding * 2}; - - position: relative; - min-width: 350px; - margin: auto; - text-align: center; - z-index: 1; - - pre { - @include hidden-scrollbar; - max-width: 70vw; - max-height: 40vh; - white-space: pre-line; - - p { - margin-bottom: $margin; - } - } - - .Spinner { - --spinner-size: 38px; - --spinner-border: calc(var(--spinner-size) / 10); - } - - .Icon { - --size: 70px; - margin: auto; - } - - a.interactive { - cursor: pointer - } -} diff --git a/src/renderer/components/cluster-manager/cluster-status.tsx b/src/renderer/components/cluster-manager/cluster-status.tsx index acd6a8a51d..a3c3f96b5f 100644 --- a/src/renderer/components/cluster-manager/cluster-status.tsx +++ b/src/renderer/components/cluster-manager/cluster-status.tsx @@ -19,7 +19,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import "./cluster-status.scss"; +import styles from "./cluster-status.module.css"; import { ipcRenderer } from "electron"; import { computed, observable, makeObservable } from "mobx"; @@ -100,31 +100,31 @@ export class ClusterStatus extends React.Component { if (!hasErrors || this.isReconnecting) { return ( - <> - +
+
             

{this.isReconnecting ? "Reconnecting" : "Connecting"}…

{authOutput.map(({ data, error }, index) => { return

{data}

; })}
- +
); } return ( - <> - +
+

{cluster.preferences.clusterName}

-
+        
           {authOutput.map(({ data, error }, index) => {
             return 

{data}

; })}
{failureReason && ( -
{failureReason}
+
{failureReason}
)}
); } render() { return ( -
+
{this.renderContent()}
);