Skip to content

Instantly share code, notes, and snippets.

View dabit3's full-sized avatar
🎡
probably nothing

Nader Dabit dabit3

🎡
probably nothing
View GitHub Profile
@dabit3
dabit3 / index.ios.js or index.android.js
Created June 18, 2016 05:00
React Native Navigator Experimental Part 3 - index.ios.js / index.android.js
import React from 'react'
import { AppRegistry } from 'react-native'
import configureStore from './app/store/configureStore'
const store = configureStore()
import TabsRootContainer from './app/containers/tabsRootContainer'
import { Provider } from 'react-redux'
const App = () => (
@dabit3
dabit3 / tabsRootContainer.js
Created June 18, 2016 05:17
React Native Navigator Experimental Part 3 - tabsRootContainer.js
import { connect } from 'react-redux'
import TabsRoot from '../components/TabsRoot'
import { changeTab } from '../actions/navActions'
function mapStateToProps (state) {
return {
tabs: state.tabReducer
}
}
@dabit3
dabit3 / TabReducer.js
Last active June 18, 2016 05:43
React Native Navigator Experimental Part 3 - TabReducer.js 2
import { NavigationExperimental } from 'react-native'
const {
Reducer: NavigationReducer
} = NavigationExperimental
const homeIcon = {
scale: 2.3,
uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAA58mlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxMTEgNzkuMTU4MzI1LCAyMDE1LzA5LzEwLTAxOjEwOjIwICAgICAgICAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgICAgICAgICAgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGF
@dabit3
dabit3 / tabsRootContainer.js
Last active June 18, 2016 05:43
React Native Navigator Experimental Part 3 - tabsRootContainer.js 2
import { connect } from 'react-redux'
import TabsRoot from '../components/TabsRoot'
function mapStateToProps (state) {
return {
tabs: state.tabReducer
}
}
function mapDispatchToProps (dispatch) {
@dabit3
dabit3 / TabsRoot.js
Created June 18, 2016 05:47
React Native Navigator Experimental Part 3 - TabsRoot.js 2
import React, { Component } from 'react'
import { NavigationExperimental, TabBarIOS } from 'react-native'
const { Reducer: NavigationReducer } = NavigationExperimental
const { JumpToAction } = NavigationReducer.TabsReducer
import Recipes from '../components/Recipes'
import Samples from '../components/Samples'
import Home from '../containers/navRootContainer'
class Tabs extends Component {
@dabit3
dabit3 / listStore.js
Last active July 1, 2016 17:01
React Native + MobX listStore.js
import {observable} from 'mobx'
let index = 0
class ObservableListStore {
@observable list = []
addListItem (item) {
this.list.push({
name: item,
@dabit3
dabit3 / index.ios.js or index.android.js
Last active July 1, 2016 17:02
React Native + MobX index.ios.js or index.android.js
import React, { Component } from 'react'
import App from './app/App'
import ListStore from './app/mobx/listStore'
import {
AppRegistry,
Navigator
} from 'react-native'
class ReactNativeMobX extends Component {
@dabit3
dabit3 / App.js
Last active July 1, 2016 17:01
React Native + MobX App.js
import React, { Component } from 'react'
import { View, Text, TextInput, TouchableHighlight, StyleSheet } from 'react-native'
import {observer} from 'mobx-react/native'
import NewItem from './NewItem'
@observer
class TodoList extends Component {
constructor () {
super()
this.state = {
@dabit3
dabit3 / NewItem.js
Created July 1, 2016 17:00
React Native + MobX NewItem.js
import React, { Component } from 'react'
import { View, Text, StyleSheet, TextInput, TouchableHighlight } from 'react-native'
class NewItem extends Component {
constructor (props) {
super(props)
this.state = {
newItem: ''
}
}
@dabit3
dabit3 / Animated.sequence()
Last active December 15, 2020 07:44
React Native Animated.sequence()
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Animated
} from 'react-native'
const arr = []