diff --git a/FabricExample/.bundle/config b/FabricExample/.bundle/config deleted file mode 100644 index 848943bb..00000000 --- a/FabricExample/.bundle/config +++ /dev/null @@ -1,2 +0,0 @@ -BUNDLE_PATH: "vendor/bundle" -BUNDLE_FORCE_RUBY_PLATFORM: 1 diff --git a/FabricExample/.eslintrc.js b/FabricExample/.eslintrc.js deleted file mode 100644 index 187894b6..00000000 --- a/FabricExample/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - root: true, - extends: '@react-native', -}; diff --git a/FabricExample/.gitignore b/FabricExample/.gitignore deleted file mode 100644 index 0cab2ac6..00000000 --- a/FabricExample/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# OSX -# -.DS_Store - -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate -ios/.xcode.env.local - -# Android/IntelliJ -# -build/ -.idea -.gradle -local.properties -*.iml -*.hprof -.cxx/ -*.keystore -!debug.keystore - -# node.js -# -node_modules/ -npm-debug.log -yarn-error.log - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/ - -**/fastlane/report.xml -**/fastlane/Preview.html -**/fastlane/screenshots -**/fastlane/test_output - -# Bundle artifact -*.jsbundle - -# Ruby / CocoaPods -/ios/Pods/ -/vendor/bundle/ - -# Temporary files created by Metro to check the health of the file watcher -.metro-health-check* - -# testing -/coverage diff --git a/FabricExample/.prettierrc.js b/FabricExample/.prettierrc.js deleted file mode 100644 index 2b540746..00000000 --- a/FabricExample/.prettierrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - arrowParens: 'avoid', - bracketSameLine: true, - bracketSpacing: false, - singleQuote: true, - trailingComma: 'all', -}; diff --git a/FabricExample/.watchmanconfig b/FabricExample/.watchmanconfig deleted file mode 100644 index 0967ef42..00000000 --- a/FabricExample/.watchmanconfig +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/FabricExample/App.tsx b/FabricExample/App.tsx deleted file mode 100644 index faeccbd6..00000000 --- a/FabricExample/App.tsx +++ /dev/null @@ -1,171 +0,0 @@ -import React, {useEffect, useState} from 'react'; -import { - StyleSheet, - Text, - View, - Button, - TextInput, - Alert, - SafeAreaView, - Platform, - Image, -} from 'react-native'; -import Clipboard, {useClipboard} from '@react-native-clipboard/clipboard'; - -// Small icon of a plus for demo purposes -const TEST_IMAGE = - 'iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAYAAAA6oTAqAAAAEXRFWHRTb2Z0d2FyZQBwbmdjcnVzaEB1SfMAAABQSURBVGje7dSxCQBACARB+2/ab8BEeQNhFi6WSYzYLYudDQYGBgYGBgYGBgYGBgYGBgZmcvDqYGBgmhivGQYGBgYGBgYGBgYGBgYGBgbmQw+P/eMrC5UTVAAAAABJRU5ErkJggg=='; - -const changeListener = () => { - console.warn('Clipboard changed!'); -}; - -const App: React.FC = () => { - const [text, setText] = useState(''); - const [isURL, setIsURL] = useState(false); - const [data, setString] = useClipboard(); - const [image, setImage] = useState(null); - const [imageString, setImageString] = useState(''); - - const checkStringType = async () => { - const checkClipboard = await Clipboard.hasURL(); - setIsURL(checkClipboard); - }; - - const pasteImageAndroid = async () => { - const base64 = await Clipboard.getImage(); - setImageString(base64); - }; - - useEffect(() => { - checkStringType(); - }, [data]); - - useEffect(() => { - if (Platform.OS === 'ios' || Platform.OS === 'android') { - const listener = Clipboard.addListener(changeListener); - - return () => { - listener.remove(); - }; - } - }, []); - - const writeToClipboard = async () => { - setString(text); - Alert.alert(`Copied to clipboard: ${text}`); - }; - - const writeImageToClipboard = async () => { - Clipboard.setImage(TEST_IMAGE); - Alert.alert(`Copied Image to clipboard`); - }; - - const getImage = async () => { - if (await Clipboard.hasImage()) { - const image = await Clipboard.getImagePNG(); - setImage(image); - } else { - console.warn('No image in clipboard'); - } - }; - - return ( - - Clipboard Module - - Clipboard Contents: - {data} - Content is URL: - {JSON.stringify(isURL)} - Content is IMAGE: - {image && } - - setText(input)} - value={text} - placeholder="Type here..." - /> -