This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************************************************************************** | |
AWS Lambda boilerplate for API functions | |
This boilerplate is designed to be used with AWS API gateway and to return information | |
to a client | |
***********************************************************************************/ | |
const util = require("util"); | |
// - provide access to aws-sdk | |
//const AWS = require('aws-sdk'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin'); | |
module.exports = { | |
entry: './web/index.js', | |
output: { | |
path: path.join(__dirname, 'dist'), | |
filename: '[name].bundle.js', | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RNMessageChannel from "./react-native-webview-messaging"; | |
const dropin = require("braintree-web-drop-in"); | |
const submitButton = document.querySelector("#submit-button"); | |
let clientToken = ""; | |
const goBackButton = document.querySelector("#go-back-button"); | |
const noticeBox = document.querySelector("#notice-box"); | |
const loader = document.querySelector("#loader"); | |
// receive the tokenReceived event |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
const webpack = require("webpack"); | |
const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
module.exports = { | |
entry: "./web/braintreeReact.js", | |
output: { | |
path: path.join(__dirname, "dist"), | |
filename: "[name].bundle.js" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// download and use react an react-dom from local directory | |
// to avoid conflicts with Expo version of react | |
import React from "./react.min"; | |
import ReactDOM from "./react-dom.min"; | |
import renderIf from "render-if"; | |
import dropin from "braintree-web-drop-in"; | |
import glamorous from "glamorous"; | |
import RNMessageChannel from "react-native-webview-messaging"; | |
const util = require("util"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<SoundRecorder | |
style={{ flex: 1 }} | |
onComplete={this.soundRecorderComplete.bind(this)} | |
maxDurationMillis={150000} | |
completeButtonText={'Finished'} | |
/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
soundRecorderComplete = (soundFileInfo) => { | |
soundFileInfo = | |
typeof soundFileInfo === 'object' | |
? JSON.stringify(soundFileInfo, undefined, 2) | |
: soundFileInfo; | |
this.setState({ | |
viewToShow: 'home', | |
soundFileInfo | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
View, | |
StyleSheet, | |
Modal, | |
Keyboard, | |
KeyboardAvoidingView, | |
Animated, | |
TouchableWithoutFeedback, | |
Easing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleMessage = (event) => { | |
let msgData; | |
try { | |
msgData = JSON.parse(event.nativeEvent.data); | |
if ( | |
msgData.hasOwnProperty('prefix') && | |
msgData.prefix === MESSAGE_PREFIX | |
) { | |
console.log(`WebViewLeaflet: received message: `, msgData.payload); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Map | |
style={{ | |
width: '100%', | |
backgroundColor: 'lightblue' | |
}} | |
... | |
// handling a react-leaflet map click event | |
onClick={(event) => { | |
this.onMapEvent('onMapClicked', { | |
coords: [event.latlng.lat, event.latlng.lng] |