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
1 |
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
var MaskedInput = function (el) { | |
var mask = el.getAttribute('data-mask'); | |
var symbolArray = mask.split(''); | |
var maskArray = mask.split(''); | |
var carretPosition = symbolArray.indexOf('_'); | |
el.setAttribute('placeholder', mask); | |
/** | |
* Is char a digit? |
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
/** | |
* Synchronization store with localStorage | |
* Allows to take the default states from localStorage | |
* @param {strign} name reducer's name preferable | |
* @param {object} defaultInitial reducer's default state | |
* @return {object} initial state and methods | |
*/ | |
export default (name, defaultInitial) => { | |
const localStorageState = localStorage.getItem(`yakutia.${name}`); | |
const mergedState = localStorageState && JSON.parse(localStorageState); |
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 TYPES from './types'; | |
// Fetch hypothesis | |
export const fetchStart = ({ id, segment }) => ({ | |
type: TYPES.fetching, | |
payload: { | |
id, | |
segment, | |
}, | |
}); |
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
/** | |
* Middleware for syncing actions between tabs | |
*/ | |
export default () => (next) => (action) => { | |
if (action.sync) { | |
delete action.sync; | |
localStorage.setItem(`${__PROJECT_NAME__}.storeSync`, JSON.stringify({ | |
action, | |
_hash: Date.now(), | |
})); |
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
/** | |
* Array must containt at least nessesary values | |
* @param {Number} [count=1] nessesary values in array | |
* @param {String} [message='You must select at least one of the options'] error message | |
* @return {?String} | |
*/ | |
const atLeast = ( | |
count = 1, | |
message = 'You must select at least one of the options') => | |
(value) => { |
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 AppPropTypes from 'common/types/AppPropTypes'; | |
import styled, { css } from 'styled-components'; | |
import { applyIfNotNull } from 'styles/utils'; | |
const sizeMap = ['Zero', 'Xs', 'Sm', 'Md', 'Bg', 'Lg']; | |
const applySize = (size, inverse, theme) => { | |
return applyIfNotNull(size, () => (`${inverse ? '-' : ''}${theme[`margin${sizeMap[size]}`]}`)); | |
}; |
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 PropTypes from 'prop-types'; | |
import { connect } from 'react-redux'; | |
import { withRouter } from 'react-router-dom'; | |
import * as routes from 'config/routes'; | |
import { ACTIONS as authActions } from 'redux/modules/auth'; | |
import { ACTIONS as sitesActions, TYPES as SITES_TYPES } from 'redux/modules/sites'; | |
import { Dropdown, Menu, Avatar, Select, Tooltip } from 'antd'; |
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 React, { PureComponent } from 'react'; | |
// Helpers | |
import classNameBind from 'classnames/bind'; | |
import { upperFirst } from 'utils'; | |
import s from './TextField.pcss'; | |
const cn = classNameBind.bind(s); |
OlderNewer