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 {connect} from 'react-redux'; | |
import View from './Scientist.jsx'; | |
export default connect((state, props)=>{ | |
return { | |
...state.scientists.get(props.scientist), | |
}; | |
})(View); |
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
export default function Scientist({dob, fullname, imageSrc}) { | |
return ( | |
<div> | |
<h3>{fullname}</h3> | |
<h5>{dob}</h5> | |
<img src={imageSrc} /> | |
</div> | |
) | |
} |
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 {connect} from 'react-redux'; | |
import {compose, withPropsOnChange} from 'recompose'; | |
import View from './Scientist.jsx'; | |
export default compose( | |
connect((state, props)=>{ | |
return { | |
...state.scientists.get(props.scientist), | |
}; | |
}), |
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 "lucid-mixins"; | |
// .lucid-tab('.html', rgb(60, 120, 168)); | |
// .lucid-tab('.js', rgb(220,20,60)); | |
// .lucid-tab('.json', rgb(252,128,27)); | |
// .lucid-tab('.coffee', rgb(214,233,245)); | |
// .lucid-tab('.py', rgb(60, 120, 168)); | |
// .lucid-tab('.less', rgb(50, 90, 162)); | |
.lucid-tab('.scss', rgb(144,198,149)); | |
// .lucid-tab('.css', #29abde); |
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
.lucid-tab(@ext: ''; @color: '') { | |
tabs-bar tabs-tab .title[data-name*="@{ext}"], | |
.tab-bar .tab .title[data-name*="@{ext}"] { | |
border-top: 2px solid @color; | |
// color: @color; | |
} | |
} |
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
class Image extends Component { | |
componentDidMount() { | |
// if image hasn't completed loading, then let react handle error | |
if (!this._image.complete) return; | |
// if image has finished loading and has 'errored'(errored when naturalWidth === 0) | |
// then run the onError callback | |
if (this._image.naturalWidth === 0) { | |
this.props.onError(); | |
} | |
} |
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, PropTypes } from 'react'; | |
import { setPropTypes, withState, lifecycle, mapProps, compose } from 'recompose'; | |
export const ImageComponent = compose( | |
setPropTypes({ src: PropTypes.string.isRequired }), | |
withState('imgState', 'updateImgState', ({ src }) => ({ origSrc: src, currentSrc: src })), | |
lifecycle({ | |
componentWillReceiveProps(nextProps) { | |
// if Image components src changes, make sure we update origSrc and currentSrc | |
if (nextProps.src !== nextProps.imgState.origSrc) { |
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
# ------------------------------------------------------------------- | |
# Git | |
# ------------------------------------------------------------------- | |
alias ga='git add' | |
alias gp='git push' | |
alias gl='git log' | |
alias gs='git status' | |
alias gm='git commit -m' | |
alias gb='git branch' | |
alias gc='git checkout' |
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'; | |
export default class EventComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
this._onTouchStart = this._onTouchStart.bind(this); | |
this._onTouchMove = this._onTouchMove.bind(this); | |
this._onTouchEnd = this._onTouchEnd.bind(this); |
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 EventComponent from './EventComponent'; | |
import { mount } from 'enzyme'; | |
import { | |
createStartTouchEventObject, | |
createMoveTouchEventObject | |
} from './EventHelpers.js'; | |
describe('EventComponent', () => { |