Skip to content

Instantly share code, notes, and snippets.

View 197291's full-sized avatar
:octocat:

Yuriy Provotorov 197291

:octocat:
  • Taganrog
View GitHub Profile
@197291
197291 / api.js
Created October 26, 2017 06:52
Api client helper
import superagent from 'superagent';
import cookies from 'react-cookie';
import config from '../config';
import CryptoJS from 'crypto-js';
import _clone from 'lodash/clone';
import { normalizePayload } from 'utils/jwt';
const methods = ['get', 'post', 'put', 'patch', 'del'];
@197291
197291 / SelectPlan.js
Last active October 26, 2017 07:04
Select Plan
import React from 'react';
import PropTypes from 'prop-types';
import SelectField from 'material-ui/SelectField';
import MenuItem from 'material-ui/MenuItem';
import { RadioButton, RadioButtonGroup } from 'material-ui/RadioButton';
import RaisedButton from 'material-ui/RaisedButton';
import Paper from 'material-ui/Paper';
@197291
197291 / reducer.js
Last active October 26, 2017 07:02
Reducers
export const plansName = [
{
id: 'standard',
nameId: 'billing.plan.name.standard'
},
{
id: 'plus',
nameId: 'billing.plan.name.plus'
},
];
@197291
197291 / PaymentContainer.js
Last active October 26, 2017 06:59
Payments container
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import config from 'config';
import Helmet from 'react-helmet';
import { connect } from 'react-redux';
import { injectIntl, intlShape } from 'react-intl';
@197291
197291 / Helpers.js
Last active April 16, 2018 07:33
Helpers
export function empty(val) {
return (typeof val === 'undefined' || val === '' || val === 0 || val === '0' || val === null
|| val === false || (typeof val === 'object' && !Object.keys(val).length) || (Array.isArray(val) && !val.length )
);
}
export function apiUrl (path, params, absolut = false) {
return URL_BASE + path
}