This file contains 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 from "react"; | |
import { View, Text } from "react-native"; | |
import palx from "palx" // props to palx! | |
const ThemeContext = React.createContext(palx("#ff0066")); | |
const Alert = ({ title, text }) => { | |
return ( | |
<ThemeContext.Consumer> | |
{theme => ( | |
<View style={[ |
This file contains 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 from "react"; | |
import { View, Text } from "react-native"; | |
const Alert = ({ title, text, backgroundColor, borderColor, titleColor, descriptionColor }) => { | |
return ( | |
<ThemeContext.Consumer> | |
{theme => ( | |
<View style={[ | |
..., | |
{ |
This file contains 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 from "react"; | |
import { View, Text } from "react-native"; | |
const Alert = ({ title, text }) => { | |
return ( | |
<ThemeContext.Consumer> | |
{theme => ( | |
<View style={[ | |
..., | |
{ |
This file contains 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
... | |
(async () => { | |
await // Do something async | |
})(); | |
... |
This file contains 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 { all, call, put, takeLatest } from "redux-saga/effects"; | |
import { FETCH_USER_ORDERS_REQUEST, FETCH_USER_ORDERS_RESPONSE } from "../types"; | |
import { fetchOrdersRequest } from "../api"; | |
export function* fetchUserOrders(action, baseUrl) { | |
try { | |
const { filter } = action.payload; | |
const orders = yield call(fetchOrdersRequest, baseUrl, filter); | |
yield put({ |
This file contains 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 { put, call } from "redux-saga"; | |
export function* AbstractAPISaga( | |
action, | |
baseUrl, | |
api, | |
type, | |
) { | |
try { | |
const payload = { ...action.payload }; |
This file contains 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 { all, call, takeLatest } from "redux-saga/effects"; | |
import { FETCH_USER_ORDERS_REQUEST, FETCH_USER_ORDERS_RESPONSE } from "../types"; | |
import { fetchOrdersRequest } from "../api"; | |
import { AbstractAPISaga } from "../AbstractAPISaga"; | |
export default function* UserOrdersSaga (baseUrl) { | |
yield all([ | |
yield takeLatest(FETCH_USER_ORDERS_REQUEST, | |
action => AbstractAPISaga(action, baseUrl, fetchOrdersRequest, FETCH_USER_ORDERS_RESPONSE) | |
]); |
This file contains 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
RCT_EXPORT_METHOD( | |
confirmPaymentIntent:(NSString *)payment_intent_client_secret | |
resolvePromise:(RCTPromiseResolveBlock)resolve | |
rejectPromise:(RCTPromiseRejectBlock)reject | |
) | |
{ | |
// Create the payment intent using the payment_intent_client_secret | |
[[STPAPIClient sharedClient] retrievePaymentIntentWithClientSecret:payment_intent_client_secret completion:^(STPPaymentIntent *paymentIntent, NSError *error) { | |
NSLog(@"Intent %@", paymentIntent); |
This file contains 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
/** | |
* @author Luke Brandon Farrell | |
* @description Funnels allow us to re-use screens with react-native-navigation | |
* and build more complex patterns. In the context of this utility a stack | |
* refers to a single screen, where as a funnel refres to a collection of screens. | |
*/ | |
import { Platform } from "react-native"; | |
import { Navigation, Layout, Options } from "react-native-navigation"; | |
import * as NavigationLayouts from "react-native-navigation-layouts"; |
This file contains 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 initialState = { | |
type: null, | |
payload: null, | |
meta: null, | |
error: false | |
}; | |
export default (state = initialState, action) => { | |
return { | |
...state, |
OlderNewer