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
// In GalleryItemContainer.js | |
componentWillMount() { | |
// some stuff here... | |
this.props.fetchGalleryItem(slug); | |
} | |
... | |
// In my sagas | |
function* fetchGalleryItem({ 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 React, { PropTypes, Component } from 'react'; | |
import styled from 'styled-components'; | |
// Styled components | |
const ToggleSwitchWrapper = styled.div` | |
display: flex; | |
flex-direction: column; | |
`; | |
const Toggle = styled.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 React, { PropTypes, Component } from 'react'; | |
import styled from 'styled-components'; | |
// Styled components | |
const ToggleSwitchWrapper = styled.div` | |
display: flex; | |
flex-direction: column; | |
position: relative; | |
`; |
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 { combineReducers } from 'redux'; | |
// Import subreducers | |
import editReducer from './edit/ducks'; | |
import detailsReducer from './details/ducks'; | |
import listReducer from './list/ducks'; | |
const initialState = { | |
// common stuff here | |
}; |
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
/* | |
* EDIT DUCKS | |
*/ | |
const initialState = { | |
// edit stuff here | |
}; | |
export default function reducer(state = initialState, action = {}) { | |
switch (action.type) { |
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 styled from 'styled-components'; | |
const RippleWrapper = styled.div` | |
position: relative; | |
overflow: hidden; | |
transform: translate3d(0, 0, 0); | |
&:after { | |
content: ""; |
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 RippleBlock = withRipple(styled.div` | |
width: 100px; | |
height: 100px; | |
background-color: ${props => props.bg || '#eee'}; | |
`); | |
// or | |
const Block = styled.div` | |
width: 100px; |
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 styled from 'styled-components'; | |
import { connect } from 'react-redux'; | |
import { bindActionCreators } from 'redux'; | |
import CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup'; | |
import { addToast, removeToast, getToasts } from './ducks'; | |
// Components | |
import Toast from './components/Toast'; |
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 update from 'immutability-helper'; | |
import { createAction } from 'redux-actions'; | |
// Action types | |
export const TOAST_ADD_MESSAGE = 'TOAST_ADD_MESSAGE'; | |
export const TOAST_REMOVE_MESSAGE = 'TOAST_REMOVE_MESSAGE'; | |
export const initialState = { | |
messages: [], |
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 styled from 'styled-components'; | |
// TODO: allow overriding these via props | |
const errorColor = '#e02d2d'; | |
const errorColorDark = '#801313'; | |
const warnColor = '#ffc715'; | |
const warnColorDark = '#b78e0d'; | |
const successColor = '#22ce33'; | |
const successColorDark = '#14841f'; |
OlderNewer