diff --git a/src/renderer/components/+catalog/catalog.module.css b/src/renderer/components/+catalog/catalog.module.css index 3bdfb4484b..34f3fe2460 100644 --- a/src/renderer/components/+catalog/catalog.module.css +++ b/src/renderer/components/+catalog/catalog.module.css @@ -19,47 +19,56 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -.Catalog {} +.Catalog { + :global(.TableRow):hover .pinIcon { + display: block; + } +} .entityName { position: relative; - width: min-content; + width: 100%; max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - padding-right: 24px; + display: flex; + align-items: center; + padding: 0 var(--padding); + padding-bottom: 0; + padding-right: 24px; // + reserved space for .pinIcon + + > span { + overflow: hidden; + text-overflow: ellipsis; + padding-left: var(--padding); + } + + :global(.HotbarIcon){ + align-self: center; + + div { + /* icons with plain text */ + font-size: var(--unit); + } + + .Icon { + /* icons with font-icon */ + font-size: var(--small-size); + } + } .pinIcon { position: absolute; right: 0; - opacity: 0; transition: none; + display: none; &:hover { - /* Drop styles defined for */ + /* Drop styles defined for */ background-color: transparent; box-shadow: none; } } } -.iconCell { - padding-top: calc(var(--padding) / 2); - flex: 0 0 40px !important; - - :global(.content) { - display: none; /* hide "Icon" text in the header */ - } - - div * { - font-size: var(--unit); /* icon's with plain text */ - } - - :global(.Icon) { - font-size: var(--small-size) !important; - } -} - .sourceCell { max-width: 100px; } diff --git a/src/renderer/components/+catalog/catalog.tsx b/src/renderer/components/+catalog/catalog.tsx index a502dce2aa..2ea62c89a3 100644 --- a/src/renderer/components/+catalog/catalog.tsx +++ b/src/renderer/components/+catalog/catalog.tsx @@ -103,7 +103,7 @@ export class Catalog extends React.Component { this.activeTab = routeTab; this.catalogEntityStore.activeCategory = item; }); - } catch(error) { + } catch (error) { console.error(error); Notifications.error(

Unknown category: {routeTab}

); } @@ -167,15 +167,15 @@ export class Catalog extends React.Component { const activeCategory = this.categories.find(category => category.getId() === tabId); if (activeCategory) { - navigate(catalogURL({ params: { group: activeCategory.spec.group, kind: activeCategory.spec.names.kind }})); + navigate(catalogURL({ params: { group: activeCategory.spec.group, kind: activeCategory.spec.names.kind } })); } else { - navigate(catalogURL({ params: { group: browseCatalogTab }})); + navigate(catalogURL({ params: { group: browseCatalogTab } })); } }; renderNavigation() { return ( - + ); } @@ -212,23 +212,7 @@ export class Catalog extends React.Component { const isItemInHotbar = HotbarStore.getInstance().isAddedToActive(item.entity); return ( -
- {item.name} - isItemInHotbar ? this.removeFromHotbar(item) : this.addToHotbar(item))} - /> -
- ); - } - - renderIcon(item: CatalogEntityItem) { - return ( - + <> { background={item.entity.spec.icon?.background} size={24} /> - + {item.name} + isItemInHotbar ? this.removeFromHotbar(item) : this.addToHotbar(item))} + /> + ); } @@ -268,8 +261,7 @@ export class Catalog extends React.Component { entity => entity.searchFields, ]} renderTableHeader={[ - { title: "Icon", className: styles.iconCell, id: "icon" }, - { title: "Name", sortBy: sortBy.name, id: "name" }, + { title: "Name", className: styles.entityName, sortBy: sortBy.name, id: "name" }, !activeCategory && { title: "Kind", sortBy: sortBy.kind, id: "kind" }, { title: "Source", className: styles.sourceCell, sortBy: sortBy.source, id: "source" }, { title: "Labels", className: styles.labelsCell, id: "labels" }, @@ -279,7 +271,6 @@ export class Catalog extends React.Component { disabled: !item.enabled, })} renderTableContents={item => [ - this.renderIcon(item), this.renderName(item), !activeCategory && item.kind, item.source, diff --git a/src/renderer/components/icon/push-pin.svg b/src/renderer/components/icon/push_pin.svg similarity index 100% rename from src/renderer/components/icon/push-pin.svg rename to src/renderer/components/icon/push_pin.svg