Skip to content

Instantly share code, notes, and snippets.

@darotar
darotar / SuccessTableStore.js
Created June 21, 2018 06:18
Example of Mobx table operations store
import { observable, action } from 'mobx';
import OperationTablesService from '../services/OperationTablesService';
import storage from '../helpers/storage';
class SuccessTableStore {
filter = storage.get('filter');
pageCount = 20;
@observable operations = [];
@observable totalCount = 0;
@observable tableCount = 0;
@darotar
darotar / UserVoiceBubble.js
Created June 21, 2018 06:09
Bubble for user voting about new service design
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames/bind';
import FirmFlagService from './../../services/FirmFlagServiсe';
import style from './style..less';
const cn = classnames.bind(style);
class UserVoiceBubble extends Component {
constructor(props) {
@darotar
darotar / ElementsGroup.js
Created June 21, 2018 06:02
RadioGroup enterprise reusable component
import React from 'react';
import classnames from 'classnames/bind';
import PropTypes from 'prop-types';
import style from './style.less';
const cn = classnames.bind(style);
class ElementsGroup extends React.Component {
getStyle = (i) => {
@darotar
darotar / LocalStorage.js
Created June 21, 2018 05:47
NoveltyLabel - компонент лейбла, отображаемого для пользователя рядом с новым функционалом в сервисе. Как только пользователь кликает по новому функционалу, либо переходит на нужную ссылку, информация сохраняется в localStorage и лейбл более не отображается
export default class LocalStorage {
static get(name) {
return localStorage[name] ? JSON.parse(localStorage[name]) : undefined;
}
static set(name, value) {
localStorage[name] = JSON.stringify(value);
}
static delete(name) {