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 axios from 'axios'; | |
import qs from 'qs'; | |
import * as humps from 'humps'; | |
import { API_URL } from '@/common/config'; | |
import tokenHelper from '@/helpers/browser/tokenHelper'; | |
const request = axios.create({ | |
baseURL: API_URL, | |
headers: { |
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 { Redirect, Route } from 'react-router-dom'; | |
import { Routes } from '@/common/constants'; | |
import { Navbar } from '@/containers/navbar'; | |
/* The component draws admin pages */ |
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 * as humps from 'humps'; | |
/** | |
* Decamelize form data keys and values | |
* @param {FormData} formData | |
* @param {Object} [options] | |
* @return {FormData} | |
*/ | |
export const decamelizeFormDataKeys = (formData, options) => { | |
const decamelizedFormData = new FormData(); |
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 interface IImmutableMap<Model, State = Model> extends Immutable.Map<any, any> { | |
toObject(): State; | |
get<K extends keyof State>(key: K): State[K]; | |
getIn<K extends keyof State>(searchKeyPath: [K], notSetValue?: any): State[K]; | |
getIn< | |
K extends keyof Model, | |
K2 extends keyof Model[K] | |
>(searchKeyPath: [K, K2], notSetValue?: any): Model[K][K2]; | |
set<K extends keyof State>(key: K, value: State[K]): this; | |
setIn<K extends keyof State>(keyPath: [K], value: any): this; |
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 { Redirect, Route } from 'react-router-dom'; | |
import { Routes } from 'common/constants'; | |
/* The component draws pages for authentication, if the user is not authorized. | |
Otherwise, it redirects to the main page. | |
*/ | |
const AuthLayoutComponent = ({ |
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 { createStore, applyMiddleware } from 'redux'; | |
import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly'; | |
import rootReducer from './root-reducer'; | |
import createHistory from 'history/createBrowserHistory'; | |
import { connectRouter, routerMiddleware } from 'connected-react-router'; | |
import createSagaMidleware from 'redux-saga'; | |
import rootSaga from './root-saga'; | |
export const history = createHistory(); |
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
{ | |
"parser": "babel-eslint", | |
"plugins": [ | |
"import", | |
"react" | |
], | |
"extends": [ | |
"airbnb" | |
], | |
"env": { |
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 default class Card extends Component { | |
static Top = ({ children, ...props }) => ( | |
<Box px={25} position="absolute" top="-20px" left="0" zIndex="1" {...props}> | |
{children} | |
</Box> | |
) | |
static Main = ({ children, ...props }) => ( | |
<Box {...props}>{children}</Box> |
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 compose = (...functions) => { | |
return (...args) => { | |
let result = functions[functions.length - 1](...args); | |
for(let i = functions.length - 2; i >= 0; i--) { | |
result = functions[i](result) | |
} | |
return result; | |
} | |
} |
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 firebase from 'firebase/app'; | |
import 'firebase/database'; | |
import { firebaseConfig } from '@/common/config'; | |
import { firebaseKeys } from '@/common/constants'; | |
firebase.initializeApp(firebaseConfig); | |
const database = firebase.database(); | |
const snapshotMapper = snap => { |
NewerOlder