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:
@@ -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>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user