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 { remCalc } from '@lib/helperMethods'; | |
import { mergeObjectify, objectify } from '@lib/arrays'; | |
import { | |
LARGE_DESKTOP, | |
LARGE_DESKTOP_HD, | |
LARGE_MOBILE, | |
MEDIUM_DESKTOP, | |
MEDIUM_DESKTOP_HD, | |
MEDIUM_MOBILE, | |
SMALL_DESKTOP, |
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 from 'react'; | |
export interface DynamicComponentProps { | |
_componentTypes: Record<string, any>; | |
name: string; | |
[key: string]: any; | |
} | |
const DynamicComponent = ({ | |
_componentTypes, |
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 delivery = { | |
item: null, | |
}; | |
const andAndMethod = (delivery && delivery.item && delivery.item.name) || "Untitled Product"; | |
const typeOfMethod =( | |
typeof delivery != 'undefined' && | |
typeof delivery.item != 'undefined' && | |
typeof delivery.item.name != 'undefined' && |
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 data = { | |
title: "company", | |
white: 44, | |
black: 3, | |
asian: 23, | |
hispanic: 5, | |
undefined: 25, | |
}; | |
// this.props.data["white"] === 44 |
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
class App extends Component { | |
componentDidMount() { | |
this._loadSession().done(); | |
} | |
componentWillReceiveProps(nextProps) { | |
if (!this.props.userState.loggedIn && nextProps.userState.currentUser.sessionToken) { | |
this._setSession(nextProps.userState.currentUser.sessionToken).done(); | |
} | |
} |
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
'use strict'; | |
import React, { | |
Component, | |
Animated, | |
Easing, | |
Dimensions, | |
StyleSheet | |
} from 'react-native'; |
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
/** | |
* | |
* My Attempt at the Twitter Mobile scroll and grow header interaction in | |
* React Native. The problem I am running into problems with the rendering | |
* at the top. I have tried animating translateY, top and margin top. All | |
* do the exact same thing. The only thing I can think to do to get around | |
* this is position the element at a negative margin to compensate for the | |
* jumping around. | |
* | |
**/ |
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
var SwitchBox = React.createClass({ | |
propTypes: { | |
height: React.PropTypes.number.isRequred, | |
width: React.PropTypes.number.isRequred, | |
emitSelected: React.PropTypes.func | |
}, | |
getInitialState() { | |
return { selected: false } | |
}, |
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
var MaterialSelect = React.createClass({ | |
getInitialState: function() { | |
return { | |
open: false, | |
inputValue: this.props.placeholder, | |
options: this.props.options | |
} | |
}, | |
_triggerOpen: function() { |
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
func scrollViewDidScroll(scrollView: UIScrollView) { | |
if scrollView.contentOffset.y <= pointNow { | |
// Up | |
UIView.animateWithDuration( | |
0.0, | |
delay: 0.0, | |
options: .CurveEaseOut, | |
animations: { | |
self.addToProfileBtn.center.y = 32 | |
}, |