Skip to content

Commit

Permalink
adding haptic feedback and native browser function
Browse files Browse the repository at this point in the history
  • Loading branch information
markspereira committed Jul 12, 2019
1 parent 8644f48 commit cd89cf4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -10,12 +10,14 @@
"3box-activity": "^0.0.9",
"@react-native-mapbox-gl/maps": "^7.0.0-rc3",
"ethers": "^4.0.31",
"lodash": "^4.17.14",
"moment": "^2.24.0",
"react": "16.8.3",
"react-native": "0.59.9",
"react-native-camera": "^2.10.1",
"react-native-code-push": "^5.6.0",
"react-native-gesture-handler": "^1.3.0",
"react-native-haptic-feedback": "^1.8.2",
"react-native-modal": "^11.0.1",
"react-native-modalize": "^1.1.1",
"react-native-onesignal": "^3.2.14",
Expand Down
9 changes: 5 additions & 4 deletions src/AliceSDK/Web3/index.js
Expand Up @@ -45,9 +45,9 @@ const signMessage = async (message) => {
}
}

const settingsPopUp = () => {
return NativeModules.NativeVCModule.setting();
}
const settingsPopUp = () => NativeModules.NativeVCModule.setting();

const openBrowser = () => NativeModules.NativeVCModule.browser();

const sendToken = () => {

Expand Down Expand Up @@ -79,7 +79,8 @@ const walletChangeEvent = () => {
};

export const Settings = {
settingsPopUp
settingsPopUp,
openBrowser
};

export const Wallet = {
Expand Down
15 changes: 12 additions & 3 deletions src/Apps/index.js
Expand Up @@ -13,12 +13,20 @@ import {
import Icon from '../AliceComponents/IconComponent';
import {navigate} from "../AliceUtils/navigationWrapper";
import AppIcon from "../AliceComponents/AppIcon";
import {Settings} from "../AliceSDK/Web3";

/* ExampleMaps Export Section */
export { default as Fork } from './Fork';
export { default as Foam } from './Foam';
export { default as Test } from './Example';
export { default as Mintbase } from './Mintbase';
import ReactNativeHapticFeedback from "react-native-haptic-feedback";

const options = {
enableVibrateFallback: true,
ignoreAndroidSystemSettings: false
};

const WEBVIEW = 'WEBVIEW';

export const AppRegistry = [
Expand Down Expand Up @@ -108,8 +116,9 @@ export default class AppsScreen extends Component<Props> {
modalVisible: false,
};

toggleWebView = () => {
this.setState({modalVisible: !this.state.modalVisible});
openBrowser = () => {
ReactNativeHapticFeedback.trigger("impactLight", options);
Settings.openBrowser()
};

back = () => {
Expand All @@ -135,7 +144,7 @@ export default class AppsScreen extends Component<Props> {
<TouchableOpacity style={{width: 34, height: 34, borderRadius: 17, backgroundColor: 'rgba(0,0,0,0.2)', alignItems: 'center', justifyContent: 'center'}} onPress={() => navigate('Profile')}>
<Image source={require('../AliceAssets/avatar-black.png')} style={{ resizeMode: 'contain', width: 17, height: 17 }}/>
</TouchableOpacity>
<TouchableOpacity style={{width: 34, height: 34, borderRadius: 17, backgroundColor: 'rgba(0,0,0,0.2)', alignItems: 'center', justifyContent: 'center'}} onPress={this.toggleWebView}>
<TouchableOpacity style={{width: 34, height: 34, borderRadius: 17, backgroundColor: 'rgba(0,0,0,0.2)', alignItems: 'center', justifyContent: 'center'}} onPress={this.openBrowser}>
<Image source={require('../AliceAssets/browser-icon.png')} style={{ resizeMode: 'contain', width: 17, height: 17 }}/>
</TouchableOpacity>
</View>
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Expand Up @@ -4155,6 +4155,11 @@ lodash@^4.17.11, lodash@^4.17.5, lodash@^4.3.0, lodash@^4.6.1:
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==

lodash@^4.17.14:
version "4.17.14"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba"
integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==

loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
Expand Down Expand Up @@ -5623,6 +5628,11 @@ react-native-gesture-handler@^1.3.0:
invariant "^2.2.2"
prop-types "^15.5.10"

react-native-haptic-feedback@^1.8.2:
version "1.8.2"
resolved "https://registry.yarnpkg.com/react-native-haptic-feedback/-/react-native-haptic-feedback-1.8.2.tgz#532dfcdfe2eaaaf3c30ff5dff97973ff05399fcd"
integrity sha512-arY2vsQtcF6Z/HggcfASTFzXm5HLUvK08rj6xPs6b95mpUDyStxEoC2c6MCFx+GSqnpBuOQvQCf42Zp0ATnWoQ==

react-native-modal@^11.0.1:
version "11.0.1"
resolved "https://registry.yarnpkg.com/react-native-modal/-/react-native-modal-11.0.1.tgz#0c7e546557938981f188c56b80474ddfe7c9835c"
Expand Down

0 comments on commit cd89cf4

Please sign in to comment.