Add clickable link to reverse share's shares

This commit is contained in:
pierrbt
2023-06-29 20:07:00 +02:00
parent f96ac5e4ba
commit 36fa76563e

View File

@@ -1,6 +1,7 @@
import { import {
Accordion, Accordion,
ActionIcon, ActionIcon,
Anchor,
Box, Box,
Button, Button,
Center, Center,
@@ -34,6 +35,8 @@ const MyShares = () => {
const [reverseShares, setReverseShares] = useState<MyReverseShare[]>(); const [reverseShares, setReverseShares] = useState<MyReverseShare[]>();
const appUrl = config.get("general.appUrl");
const getReverseShares = () => { const getReverseShares = () => {
shareService shareService
.getMyReverseShares() .getMyReverseShares()
@@ -119,9 +122,11 @@ const MyShares = () => {
<Accordion.Panel> <Accordion.Panel>
{reverseShare.shares.map((share) => ( {reverseShare.shares.map((share) => (
<Group key={share.id} mb={4}> <Group key={share.id} mb={4}>
<Text maw={120} truncate> <Anchor href={`${appUrl}/share/${share.id}`}>
{share.id} <Text maw={120} truncate>
</Text> {share.id}
</Text>
</Anchor>
<ActionIcon <ActionIcon
color="victoria" color="victoria"
variant="light" variant="light"
@@ -129,9 +134,7 @@ const MyShares = () => {
onClick={() => { onClick={() => {
if (window.isSecureContext) { if (window.isSecureContext) {
clipboard.copy( clipboard.copy(
`${config.get( `${appUrl}/share/${share.id}`
"general.appUrl"
)}/share/${share.id}`
); );
toast.success( toast.success(
"The share link was copied to the keyboard." "The share link was copied to the keyboard."