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 * as React from 'react'; | |
import { StoryDecorator } from 'storybook__react'; | |
import { ThemeProvider } from 'styled-components'; | |
/** | |
* Storybook styled-components theme provider | |
*/ | |
export function withTheme(theme): StoryDecorator { |
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 * as React from 'react'; | |
import { Modal, ModalProps } from './semantic'; | |
export function withModal<T extends {} = any>( | |
modalOptions: ModalProps | ((props: T) => ModalProps), | |
) { | |
return BaseComponent => props => { | |
const modalProps = | |
typeof modalOptions === 'function' ? modalOptions(props) : modalOptions; |
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 { compose, lifecycle, withState } from 'recompose'; | |
import { History, UnregisterCallback } from 'history'; | |
type Props = { | |
pristine: boolean; | |
history: History; | |
}; | |
type State = { | |
historyBlock: UnregisterCallback; |
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 * as React from 'react'; | |
import { compose, withStateHandlers } from 'recompose'; | |
import Confirm from 'semantic-ui-react/dist/commonjs/addons/Confirm/Confirm'; | |
/** | |
* with confirm hoc | |
* wraps an underlying component with a modal action confirmation | |
*/ | |
export type ConfirmOptions = { |
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 * as React from 'react'; | |
import styled from 'styled-components'; | |
import { Col, Grid, Row } from 'react-styled-flexboxgrid'; | |
import Form from 'semantic-ui-react/dist/commonjs/collections/Form/Form'; | |
import { SubheaderCentered } from '../typography/Subheader'; | |
/** | |
* |-------------------| | |
* | | |
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 { isType } from 'typescript-fsa'; | |
import { Reducer } from 'redux'; | |
import * as actions from './actions'; | |
/** | |
* Item-List local store | |
*/ | |
export interface LocalState { |
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
/** | |
* Recipe Editor Local Actions | |
*/ | |
import actionCreatorFactory from 'typescript-fsa'; | |
const actionCreator = actionCreatorFactory('@@local/RecipeEditor'); | |
export const showAddGroupDialog = actionCreator('SHOW_ADD_GROUP_DIALOG'); |
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 initialValues = { comment: 'hello'; } | |
storiesOf('Form Controls: Select', module) | |
.addDecorator(withFormValues(initialValues) | |
.add('default', () => ( | |
<Select name="select" label="Country..." options={selectOptions} /> | |
</Formik> | |
)) |
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 { withStyles } from "material-ui"; | |
import Select, { SelectProps } from "material-ui/Select"; | |
import { MenuItem } from "material-ui/Menu"; | |
type OwnProps = SelectProps & { | |
options: Array<{ label: string; value: string }>; | |
} | |
type Props = OwnProps & { |
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 P from "prop-types"; | |
import ReactSelect, { | |
Creatable as ReactSelectCreatable, | |
Async as ReactSelectAsync, | |
AsyncCreatable as ReactSelectAsyncCreatable | |
} from "react-select"; | |
import get from "lodash/get"; | |
import { Field } from "formik"; | |
import { withStyles } from "material-ui"; |