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
// @flow | |
import * as React from 'react'; | |
import styled from 'styled-components'; | |
type Props = { | |
className: string, | |
}; |
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 Dialog, { DialogActions, DialogTitle } from 'material-ui/Dialog'; | |
import { withStyles } from 'material-ui/styles'; | |
import Cropper from 'react-cropper'; | |
import 'cropperjs/dist/cropper.css'; | |
const styles = { | |
paper: { | |
backgroundColor: '#2781ca', | |
borderRadius: '5px', |
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 { CircularProgress } from 'material-ui/Progress'; | |
const BlockUIBody = styled.div` | |
position: fixed; | |
background-color: rgba(255, 255, 255, 0.5); | |
top: 0; | |
left: 0; | |
display: flex; |
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 { injectBabelPlugin } = require('react-app-rewired'); | |
module.exports = (config, env) => { | |
config = injectBabelPlugin( | |
[ | |
'babel-plugin-styled-components', | |
{ | |
displayName: true, | |
}, |
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 PropTypes from 'prop-types'; | |
// unexisted library, just for example | |
import { render } from 'react-store'; | |
import { requestUserData, successUserData, errorUserData } from 'actions' | |
const typeRolesList = PropTypes.arrayOf(PropTypes.shape({ | |
name: PropTypes.string.isRequired, | |
privelege: PropTypes.string.isRequired, |
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 getAsyncType = (type, status) => `${type}_${status}`; | |
export const getMasterActionCreator = type => { | |
const reqType = getAsyncType(type, 'REQUEST'); | |
const respType = getAsyncType(type, 'SUCCESS'); | |
const errType = getAsyncType(type, 'ERROR'); | |
const masterActionCreator = params => ({ params, type }); | |
masterActionCreator.type = 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 { inDevMode } from './enviroment'; | |
const isObject = object => typeof object === 'object' && object !== null; | |
function Logger(location, addSnapshot) { | |
const logs = []; | |
this.setLog = (previosObject, newObject, key, description = 'objects not equal') => { | |
const log = { | |
previosObject, |
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
(async () => { | |
console.log(0); | |
(async () => { | |
console.log(1); | |
console.log(await 2); | |
console.log(await 3); | |
console.log(4); | |
})(); | |
console.log(5); | |
(async () => { |
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 { createSubscription } from 'create-subscription'; | |
const shallowCompare = (newObj, oldObj) => { | |
const newObjKeys = Object.keys(newObj); | |
const oldObjKeys = Object.keys(oldObj); | |
return ( | |
newObjKeys.length === oldObjKeys.length && newObjKeys.every(key => newObj[key] === oldObj[key]) | |
); | |
}; |
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 isObject = o => typeof o === 'object' && o !== null; | |
const merge = (source, key, update) => | |
Array.isArray(source) | |
? [...source.slice(0, key > 0 ? key - 1 : 0), update, ...source.slice(key + 1)] | |
: { ...source, [key]: update }; | |
const mergeIn = (source, target, update) => | |
source === target | |
? Array.isArray(source) ? update : { ...source, ...update } |
OlderNewer