kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Use 'copy' function for copying group uri
rodzic
e43a9164b7
commit
68be77fa54
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
import { Avatar, Divider, HStack, Stack, Text, Button } from 'soapbox/components/ui';
|
import { Avatar, Divider, HStack, Stack, Text, Button } from 'soapbox/components/ui';
|
||||||
|
import copy from 'soapbox/utils/copy';
|
||||||
|
|
||||||
import type { Group } from 'soapbox/schemas';
|
import type { Group } from 'soapbox/schemas';
|
||||||
|
|
||||||
|
@ -10,11 +11,7 @@ interface IConfirmationStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
const ConfirmationStep: React.FC<IConfirmationStep> = ({ group }) => {
|
const ConfirmationStep: React.FC<IConfirmationStep> = ({ group }) => {
|
||||||
const handleCopyLink = () => {
|
const handleCopyLink = () => copy(group.uri);
|
||||||
if (navigator.clipboard) {
|
|
||||||
navigator.clipboard.writeText(group.uri);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleShare = () => {
|
const handleShare = () => {
|
||||||
navigator.share({
|
navigator.share({
|
||||||
|
@ -90,9 +87,11 @@ const ConfirmationStep: React.FC<IConfirmationStep> = ({ group }) => {
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{group.uri && (
|
||||||
<Button onClick={handleCopyLink} theme='transparent' icon={require('@tabler/icons/link.svg')} className='text-primary-600'>
|
<Button onClick={handleCopyLink} theme='transparent' icon={require('@tabler/icons/link.svg')} className='text-primary-600'>
|
||||||
<FormattedMessage id='manage_group.confirmation.copy' defaultMessage='Copy link' />
|
<FormattedMessage id='manage_group.confirmation.copy' defaultMessage='Copy link' />
|
||||||
</Button>
|
</Button>
|
||||||
|
)}
|
||||||
</HStack>
|
</HStack>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
|
|
Ładowanie…
Reference in New Issue