Skip to content

Commit

Permalink
Add icons to relations box (#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
nazywam committed May 8, 2023
1 parent ca23750 commit 1156677
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion mwdb/web/src/components/ShowObject/Views/RelationsBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import React, { useState, useContext } from "react";
import { Link } from "react-router-dom";
import Pagination from "react-js-pagination";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faPlus, faTrash } from "@fortawesome/free-solid-svg-icons";
import {
faFile,
faTable,
faScroll,
faPlus,
faTrash,
} from "@fortawesome/free-solid-svg-icons";
import { toast } from "react-toastify";

import { APIContext } from "@mwdb-web/commons/api";
Expand Down Expand Up @@ -217,6 +223,7 @@ function RelationsBox(props) {
return (
<div className="card card-default">
<div className="card-header">
{props.icon && <FontAwesomeIcon icon={props.icon} size="1x" />}
{props.header || "Relations"}
{!api.remote ? (
<Link
Expand Down Expand Up @@ -297,6 +304,7 @@ function TypedRelationsBox(props) {
<div>
<RelationsBox
header={`${props.header}: ${typedRelationsCount}`}
icon={props.icon}
updateRelationsActivePage={() =>
updateActivePage(
activePage,
Expand Down Expand Up @@ -334,18 +342,21 @@ export default function MultiRelationsBox() {
<TypedRelationsBox
header="Related samples"
type="file"
icon={faFile}
itemsCountPerPage={itemsCountPerPage}
{...{ parents, children }}
/>
<TypedRelationsBox
header="Related configs"
type="static_config"
icon={faTable}
itemsCountPerPage={itemsCountPerPage}
{...{ parents, children }}
/>
<TypedRelationsBox
header="Related blobs"
type="text_blob"
icon={faScroll}
itemsCountPerPage={itemsCountPerPage}
{...{ parents, children }}
/>
Expand Down
1 change: 1 addition & 0 deletions mwdb/web/src/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ table.table.share-table thead th {

/* Navigation icons */
.nav-item svg,
.card-header svg,
.detailed-view-header svg {
margin-right: 6pt;
}
Expand Down

0 comments on commit 1156677

Please sign in to comment.