Skip to content

Commit

Permalink
add lucene examples back
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tylerbarna committed Dec 8, 2024
1 parent fb50eea commit 7edb810
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/routes/circulars._archive._index/LuceneMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import { Link } from '@remix-run/react'
import { Button } from '@trussworks/react-uswds'
import CopyToClipboard from 'react-copy-to-clipboard'

Check warning on line 3 in app/routes/circulars._archive._index/LuceneMenu.tsx

View check run for this annotation

Codecov / codecov/patch

app/routes/circulars._archive._index/LuceneMenu.tsx#L1-L3

Added lines #L1 - L3 were not covered by tests

export function LuceneAccordion() {
function copyableButton(text: string) {
return (

Check warning on line 7 in app/routes/circulars._archive._index/LuceneMenu.tsx

View check run for this annotation

Codecov / codecov/patch

app/routes/circulars._archive._index/LuceneMenu.tsx#L5-L7

Added lines #L5 - L7 were not covered by tests
<CopyToClipboard text={text}>
<Button type="button" outline>
{text}
</Button>
</CopyToClipboard>
)
}
return (

Check warning on line 15 in app/routes/circulars._archive._index/LuceneMenu.tsx

View check run for this annotation

Codecov / codecov/patch

app/routes/circulars._archive._index/LuceneMenu.tsx#L15

Added line #L15 was not covered by tests
<details>
<summary>Advanced Search</summary>
Expand All @@ -13,6 +24,12 @@ export function LuceneAccordion() {
Lucene Search Syntax Page
</Link>
{'. '}
<h4>Lucene Examples (click to copy):</h4>
<div>
{copyableButton('subject:"Swift"')}
{copyableButton('body:"GRB"')}
{copyableButton('submitter:"Tomas Ahumada Mena"')}
</div>
</div>
</details>
)
Expand Down

0 comments on commit 7edb810

Please sign in to comment.