diff --git a/packages/core-mobile/app/new/routes/(signedIn)/(tabs)/portfolio/index.tsx b/packages/core-mobile/app/new/routes/(signedIn)/(tabs)/portfolio/index.tsx index 1ec9cbd7e4..cd480c3810 100644 --- a/packages/core-mobile/app/new/routes/(signedIn)/(tabs)/portfolio/index.tsx +++ b/packages/core-mobile/app/new/routes/(signedIn)/(tabs)/portfolio/index.tsx @@ -2,8 +2,13 @@ import React from 'react' import { Text, ScrollView, View, Button } from '@avalabs/k2-alpine' import { Link } from 'expo-router' import BlurredBarsContentLayout from 'new/components/navigation/BlurredBarsContentLayout' +import { copyToClipboard } from 'new/utils/clipboard' const PortfolioHomeScreen = (): JSX.Element => { + const handleCopyToClipboard = (): void => { + copyToClipboard('test') + } + return ( { Go to Portfolio Assets + diff --git a/packages/core-mobile/app/new/utils/clipboard.ts b/packages/core-mobile/app/new/utils/clipboard.ts new file mode 100644 index 0000000000..b5c18ad1f8 --- /dev/null +++ b/packages/core-mobile/app/new/utils/clipboard.ts @@ -0,0 +1,11 @@ +import Clipboard from '@react-native-clipboard/clipboard' +import { showSnackbar } from './toast' + +export const copyToClipboard = (str?: string, message = 'Copied'): void => { + if (str) { + Clipboard.setString(str) + showSnackbar(message) + } else { + Clipboard.setString('') //better to clean clipboard than let user paste something unintentionally + } +}