From 7edb8106dfbd8387e0ada55e1e607014e30c91c1 Mon Sep 17 00:00:00 2001 From: Tyler Barna Date: Sun, 8 Dec 2024 14:19:22 -0600 Subject: [PATCH] add lucene examples back this restores the lucene example buttons, but rather than populating the search bar, this copies them to the clipboard. There is not a visual feedback for this at the moment, but something like (https://remix.run/resources/remix-toast)[this] could be useful --- .../circulars._archive._index/LuceneMenu.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/routes/circulars._archive._index/LuceneMenu.tsx b/app/routes/circulars._archive._index/LuceneMenu.tsx index e499844aa..1c197f4f4 100644 --- a/app/routes/circulars._archive._index/LuceneMenu.tsx +++ b/app/routes/circulars._archive._index/LuceneMenu.tsx @@ -1,6 +1,17 @@ import { Link } from '@remix-run/react' +import { Button } from '@trussworks/react-uswds' +import CopyToClipboard from 'react-copy-to-clipboard' export function LuceneAccordion() { + function copyableButton(text: string) { + return ( + + + + ) + } return (
Advanced Search @@ -13,6 +24,12 @@ export function LuceneAccordion() { Lucene Search Syntax Page {'. '} +

Lucene Examples (click to copy):

+
+ {copyableButton('subject:"Swift"')} + {copyableButton('body:"GRB"')} + {copyableButton('submitter:"Tomas Ahumada Mena"')} +
)