From 68be77fa542f3eabaa57ab6ff5da9b744ad76f20 Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Wed, 19 Apr 2023 16:44:22 -0400 Subject: [PATCH] Use 'copy' function for copying group uri --- .../steps/confirmation-step.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/soapbox/features/ui/components/modals/manage-group-modal/steps/confirmation-step.tsx b/app/soapbox/features/ui/components/modals/manage-group-modal/steps/confirmation-step.tsx index 7db6d9c20..af1a5c363 100644 --- a/app/soapbox/features/ui/components/modals/manage-group-modal/steps/confirmation-step.tsx +++ b/app/soapbox/features/ui/components/modals/manage-group-modal/steps/confirmation-step.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; import { Avatar, Divider, HStack, Stack, Text, Button } from 'soapbox/components/ui'; +import copy from 'soapbox/utils/copy'; import type { Group } from 'soapbox/schemas'; @@ -10,11 +11,7 @@ interface IConfirmationStep { } const ConfirmationStep: React.FC = ({ group }) => { - const handleCopyLink = () => { - if (navigator.clipboard) { - navigator.clipboard.writeText(group.uri); - } - }; + const handleCopyLink = () => copy(group.uri); const handleShare = () => { navigator.share({ @@ -90,9 +87,11 @@ const ConfirmationStep: React.FC = ({ group }) => { )} - + {group.uri && ( + + )} );