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
// @flow | |
import React, { createContext, PureComponent, Children, type Element, type Component } from 'react'; | |
import { Animated, Keyboard } from 'react-native'; | |
export type OptionsTypes = 'alert' | 'warning' | 'success' | |
export type Option = { | |
icon?: number, | |
text: string, | |
onPress: 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
const webpack = require('webpack') | |
module.exports = config => Object.assign({}, { | |
module: { | |
loaders: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, | |
loader: 'babel-loader' | |
}, |
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
// Component JS file | |
import React from 'react' | |
import s from './style.scss' // <--- Imported into JS file | |
const SomeComponent = () => ( | |
<div className={s.container}> // <---- Can use more simple classes as they're automatically name-spaced | |
<span className={s.text}>Hello!</span> | |
</div> | |
) |
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
// WithWrapper.js | |
const withWrapper = (Component, name) => ({ wrapper, ...props }) => { | |
if (wrapper) { | |
return ( | |
<div className={`${name}_wrapper`}> | |
<Component {...props} /> | |
</div> | |
) | |
} | |
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
<Alert bar success>Alert Bar</Alert> | |
<div class="alert_wrapper"> | |
<div class="alert-bar-success">Alert Bar</div> | |
</div> |
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
export type Action = { | |
type: string, | |
payload?: Object | |
} | |
import { Action } from '../types' | |
const signInRequest: Function = (): Action => ({ | |
type: actionTypes.SIGN_IN_REQUEST | |
}) |
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 signUpRequest: Function = (): { type: string } => ({ | |
type: actionTypes.SIGN_UP_REQUEST | |
}) | |
const signUpSuccess: Function = ({ data }: { data: Object }): { type: string, payload: { data: Object } } => ({ | |
type: actionTypes.SIGN_UP_SUCCESS, | |
payload: { data } | |
}) | |
const signUpFailure: Function = ({ error }: { error: Object }): { type: string, payload: { error: Object } } => ({ |
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 H = require ( 'highland' ); | |
const R = require ( 'ramda' ); | |
const itemGenerator = require ( '../lib/itemGenerator.js' ); | |
const itemStore = require ( '../lib/itemStore.js' ); | |
const filterBySpotContext = require ( '../lib/filterBySpotContext.js' ); | |
const config = require ( 'config' ); | |
module.exports = R.curry ( ( utils, req, res ) => { | |
const annotationUris = R.reject ( R.isEmpty, ( req.query.annotation_uri || '' ).split ( '~' ) ); | |
const confidence = parseFloat ( req.query.confidence || config.defaultConfidence ); |
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' | |
import PropTypes from 'prop-types' | |
import styled from 'radium' | |
import SimpleHeader from '../../components/SimpleHeader' | |
import Image from '../../components/Image' | |
import HeaderFeature from '../../components/HeaderFeature' | |
import GridFeature from '../../components/GridFeature' | |
import MainFeature from '../../components/MainFeature' | |
import CTAFeature from '../../components/CTAFeature' | |
import FooterFeature from '../../components/FooterFeature' |
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 updateUsers = () => async dispatch => { | |
dispatch(fetchUsersBegin()) | |
try { | |
const users = await userService.fetch() | |
dispatch(updateUsersSuccess(users)) | |
catch (err) { | |
dispatch(updateUsersFailure(err)) | |
} | |
} |