From abcd6ce343b920b1f23230ae468f0de9984aa6eb Mon Sep 17 00:00:00 2001 From: Peter Tandler Date: Sun, 11 Jun 2023 16:06:09 +0200 Subject: [PATCH] enable copying of OID to clipboard --- src/DirectoryBreadcrumbs.jsx | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/DirectoryBreadcrumbs.jsx b/src/DirectoryBreadcrumbs.jsx index 18b1d7d..c839558 100644 --- a/src/DirectoryBreadcrumbs.jsx +++ b/src/DirectoryBreadcrumbs.jsx @@ -2,6 +2,8 @@ import React from 'react'; import Breadcrumb from 'react-bootstrap/Breadcrumb'; import { useHistory, useLocation } from 'react-router-dom'; import { OverlayTrigger, Tooltip } from "react-bootstrap"; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faInfoCircle } from "@fortawesome/free-solid-svg-icons"; export function DirectoryBreadcrumbs() { const location = useLocation(); @@ -12,26 +14,25 @@ export function DirectoryBreadcrumbs() { breadcrumbs.unshift(state) } - // TODO: enable copying of OID to clipboard ##### return ( { breadcrumbs.map((state, i) => { const index = breadcrumbs.length - i - 1 // revert index - let item = { - if (index) history.go(-index); - }} - active={!index}> + return { + if (index) history.go(-index); + }} + active={!index}> {state.label} + {state.oid && !index && <> OID: {state.oid}} + > + + } ; - return ( - state.oid - ? OID: {state.oid}}> - {item} - - : item - ); }) }