diff --git a/src/renderer/components/+catalog/catalog.module.css b/src/renderer/components/+catalog/catalog.module.css index 4c529a0934..3b5100a297 100644 --- a/src/renderer/components/+catalog/catalog.module.css +++ b/src/renderer/components/+catalog/catalog.module.css @@ -19,10 +19,19 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +.list :global(.TableRow) { + .pinIcon { + @apply ml-5 opacity-0 mt-[-1px]; + transition: opacity 200ms; + } + + &:hover .pinIcon { + @apply opacity-100; + } +} + .iconCell { - max-width: 40px; - display: flex; - align-items: center; + @apply flex items-center max-w-[40px]; } .iconCell > div * { diff --git a/src/renderer/components/+catalog/catalog.tsx b/src/renderer/components/+catalog/catalog.tsx index 53c15fd02c..25e6b8c128 100644 --- a/src/renderer/components/+catalog/catalog.tsx +++ b/src/renderer/components/+catalog/catalog.tsx @@ -43,6 +43,7 @@ import { catalogURL, CatalogViewRouteParam } from "../../../common/routes"; import { CatalogMenu } from "./catalog-menu"; import { HotbarIcon } from "../hotbar/hotbar-icon"; import { RenderDelay } from "../render-delay/render-delay"; +import { Icon } from "../icon"; export const previousActiveTab = createAppStorage("catalog-previous-active-tab", ""); @@ -186,6 +187,18 @@ export class Catalog extends React.Component { ); }; + renderName(item: CatalogEntityItem) { + return ( + <> + {item.name} + { + event.stopPropagation(); + this.addToHotbar(item); + }}/> + + ); + } + renderIcon(item: CatalogEntityItem) { return ( @@ -216,7 +229,7 @@ export class Catalog extends React.Component { renderHeaderTitle={activeCategory?.metadata.name || "Browse All"} isSelectable={false} isConfigurable={true} - className="CatalogItemList" + className={styles.list} store={this.catalogEntityStore} sortingCallbacks={{ [sortBy.name]: item => item.name, @@ -240,7 +253,7 @@ export class Catalog extends React.Component { })} renderTableContents={item => [ this.renderIcon(item), - item.name, + this.renderName(item), !activeCategory && item.kind, item.source, item.getLabelBadges(),