diff --git a/clip/ClipElement.tsx b/clip/ClipElement.tsx index 2ab15a5..54ca94b 100644 --- a/clip/ClipElement.tsx +++ b/clip/ClipElement.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { View, Text, Clipboard } from 'react-native'; import IconVector from 'react-native-vector-icons/FontAwesome5'; +import Toast from 'react-native-simple-toast'; export default class ClipElement extends React.Component { @@ -8,10 +9,15 @@ export default class ClipElement extends React.Component { super(props); } + onCopy() { + Clipboard.setString(this.props.title); + Toast.show('Put "' + this.props.title + '" in clipboard', Toast.SHORT); + } + render(): JSX.Element { return {this.props.title} - Clipboard.setString(this.props.title)} /> + this.onCopy()} /> ; } } \ No newline at end of file diff --git a/package.json b/package.json index 1ea41de..b6ff354 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "expo-cli": "^6.3.2", "react": "18.2.0", "react-native": "0.71.4", + "react-native-simple-toast": "^2.0.0", "react-native-vector-icons": "^9.2.0" }, "devDependencies": {