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 BaseController from './BaseController.js' | |
import ScriptService from '../services/ScriptService.js' | |
import ScriptExampleService from '../services/ScriptExampleService.js' | |
import ScriptFieldService from '../services/ScriptFieldService.js' | |
class ScriptController extends BaseController { | |
async getScriptById(req, res) { | |
const { scriptId } = req.params | |
const { userId } = req.body | |
const script = await ScriptService.getScriptByIdOrFail(scriptId, userId) |
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 { Text, Button, View } from 'react-native' | |
import { createBottomTabNavigator, createAppContainer } from 'react-navigation' | |
import io from 'socket.io-client' | |
console.disableYellowBox = true | |
/////// server | |
var app = require('express')() |
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
data: | |
{ account_id: '1155215134653438', | |
body: | |
'Californian entrepreneurs come to Ukraine and choose to stay longer. Do you know why?', | |
call_to_action_type: 'LEARN_MORE', | |
effective_authorization_category: 'NONE', | |
effective_object_story_id: '447746859304625_447752252637419', | |
enable_direct_install: false, | |
enable_launch_instant_app: false, | |
name: |
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
'use strict' | |
const bizSdk = require('facebook-nodejs-business-sdk') | |
const accessToken = 'xxx' | |
const accountId = 'act_xxx' | |
const AdAccount = bizSdk.AdAccount | |
const Campaign = bizSdk.Campaign | |
const AdSet = bizSdk.AdSet |
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, { Component } from 'react' | |
import { PushNotificationIOS, Alert } from 'react-native' | |
class PushNotificationHandler extends Component { | |
componentDidMount() { | |
console.log('component did mount') | |
PushNotificationIOS.addEventListener('register', token => { | |
console.log(token) | |
Alert.alert(token) | |
}) |
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
// Required to register for notifications | |
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings | |
{ | |
[RCTPushNotificationManager didRegisterUserNotificationSettings:notificationSettings]; | |
} | |
// Required for the register event. | |
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken | |
{ | |
[RCTPushNotificationManager didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; | |
} |
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 Filter = ({ categories, selectedCategories, toggleCategory }) => ( | |
<View style={{ flex: 1 }}> | |
<FlatList | |
data={categories} | |
extraData={selectedCategories} | |
keyExtractor={i => i.id} | |
renderItem={({ item }) => ( | |
<FilterItem | |
category={item} | |
isShown={!!selectedCategories.find(sc => sc.id === item.id)} |
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 Filter = ({ categories, selectedCategories, toggleCategory }) => { | |
const extendedCategories = categories.map(c => ({ | |
...c, | |
isShown: selectedCategories.find(sc => sc.id === c.id), | |
})) | |
return ( | |
<View style={{ flex: 1 }}> | |
<FlatList | |
data={extendedCategories} | |
keyExtractor={i => i.id} |
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 filterReducer = handleActions( | |
{ | |
[toggleSelectedCategory]: (state, { payload: { id, name } }) => { | |
const categoryExists = state.selectedCategories.find(sc => sc.id === id) | |
if (categoryExists) { | |
return { | |
...state, | |
selectedCategories: state.selectedCategories.filter(sc => sc.id !== id), | |
} | |
} |
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 { createStore, applyMiddleware } from 'redux' | |
import thunkMiddleware from 'redux-thunk' | |
import { composeWithDevTools } from 'redux-devtools-extension' | |
import reducer from './reducer' | |
import initialState from './initialState' | |
const middleware = [thunkMiddleware] | |
const store = createStore( |
NewerOlder