0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-05-10 05:18:39 +00:00

add copy-url-with-page to share/edit pages

Adds a "copy url (page N)" option to the Share dropdown (edit page) and
the source dropdown (share page). Copies a URL with a #pN hash anchor.
The existing scrollToHash handler in brewRenderer already navigates to
the correct page when the URL is opened.
This commit is contained in:
Petrinich Sergey
2026-04-21 22:54:09 +03:00
parent 1c6b47c5f2
commit 01b3d91232
3 changed files with 21 additions and 2 deletions
@@ -92,6 +92,19 @@ const SharePage = (props)=>{
<Nav.item color='blue' icon='fas fa-clone' href={`/new/${processShareId()}`}>
clone to new
</Nav.item>
<Nav.item
color='blue'
icon='fas fa-link'
onClick={()=>{navigator.clipboard.writeText(`${global.config.baseUrl}/share/${processShareId()}`);}}>
copy url
</Nav.item>
{currentBrewRendererPageNum > 1 &&
<Nav.item
color='blue'
icon='fas fa-link'
onClick={()=>{navigator.clipboard.writeText(`${global.config.baseUrl}/share/${processShareId()}#p${currentBrewRendererPageNum}`);}}>
copy url (page {currentBrewRendererPageNum})
</Nav.item>}
</Nav.dropdown>
</>
)}