From b0ddb5eb77f70dbe3823a1e271235611cf7aafa5 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Wed, 20 Oct 2021 15:04:02 +0300 Subject: [PATCH] Moving Catalog Details panel under TopBar (#4087) * Moving Catalog Details panel under TopBar Signed-off-by: Alex Andreev * Fine-tuning drawer height css rule Signed-off-by: Alex Andreev --- ...scss => catalog-entity-details.module.css} | 45 +++++++++++-------- .../+catalog/catalog-entity-details.tsx | 14 +++--- src/renderer/components/drawer/drawer.scss | 2 +- 3 files changed, 35 insertions(+), 26 deletions(-) rename src/renderer/components/+catalog/{catalog-entity-details.scss => catalog-entity-details.module.css} (68%) diff --git a/src/renderer/components/+catalog/catalog-entity-details.scss b/src/renderer/components/+catalog/catalog-entity-details.module.css similarity index 68% rename from src/renderer/components/+catalog/catalog-entity-details.scss rename to src/renderer/components/+catalog/catalog-entity-details.module.css index f63e7c3ba3..27b2c69701 100644 --- a/src/renderer/components/+catalog/catalog-entity-details.scss +++ b/src/renderer/components/+catalog/catalog-entity-details.module.css @@ -19,25 +19,32 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - .CatalogEntityDetails { - .EntityMetadata { - margin-right: $margin; - } - .EntityIcon.box.top.left { - margin-right: $margin * 2; +.entityDetails { + /* Move Details panel under TopBar line */ + height: calc(100% - var(--main-layout-header)); + margin-top: var(--main-layout-header); +} - .IconHint { - text-align: center; - font-size: var(--font-size-small); - text-transform: uppercase; - margin-top: $margin; - cursor: default; - user-select: none; - opacity: 0.5; - } +.metadata { + margin-right: var(--margin); +} - div * { - font-size: 1.5em; +.entityIcon { + margin-right: calc(var(--margin) * 3); + + .avatar { + :global(.MuiAvatar-root) { + font-size: 3ch; } - } - } + } + + .hint { + text-align: center; + font-size: var(--font-size-small); + text-transform: uppercase; + margin-top: var(--margin); + cursor: default; + user-select: none; + opacity: 0.5; + } +} diff --git a/src/renderer/components/+catalog/catalog-entity-details.tsx b/src/renderer/components/+catalog/catalog-entity-details.tsx index bff73a3fa2..40bc63fdee 100644 --- a/src/renderer/components/+catalog/catalog-entity-details.tsx +++ b/src/renderer/components/+catalog/catalog-entity-details.tsx @@ -19,7 +19,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import "./catalog-entity-details.scss"; +import styles from "./catalog-entity-details.module.css"; import React, { Component } from "react"; import { observer } from "mobx-react"; import { Drawer, DrawerItem } from "../drawer"; @@ -30,6 +30,7 @@ import { CatalogEntityDetailRegistry } from "../../../extensions/registries"; import { HotbarIcon } from "../hotbar/hotbar-icon"; import type { CatalogEntityItem } from "./catalog-entity-item"; import { isDevelopment } from "../../../common/vars"; +import { cssNames } from "../../utils"; interface Props { item: CatalogEntityItem | null | undefined; @@ -57,8 +58,8 @@ export class CatalogEntityDetails extends Component {showDetails && ( -
-
+
+
extends Component item.onRun()} size={128} data-testid="detail-panel-hot-bar-icon" + className={styles.avatar} /> {item?.enabled && ( -
+
Click to open
)}
-
+
{item.name} @@ -114,7 +116,7 @@ export class CatalogEntityDetails extends Component