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
export function sortAll(arr, key = 'key', direction = 'asc', type = 'string') { | |
return arr.sort((a, b) => { | |
let keyA; | |
let keyB; | |
if (type === 'string') { | |
keyA = a[key].toLowerCase(); | |
keyB = b[key].toLowerCase(); | |
} | |
if (type === 'number') { | |
keyA = parseInt(a[key], 2); |
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
export const getMultiSortedValues = (arr, key, num) => | |
arr.sort((a, b) => { | |
if (a[num] === b[num]) return a[key].localeCompare(b[key]); | |
return b[num] - a[num]; | |
}); |
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 moment from 'moment'; | |
export const email = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
export const specialCharactersRegex = /^[0-9a-zA-Z _-]{1,30}$/; | |
export const required = value => (!value ? 'Required' : undefined); | |
export const isEqual = (value, compareValue) => (value === compareValue); |
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 Select from 'react-select'; | |
import PropTypes from 'prop-types'; | |
import 'react-select/dist/react-select.css'; | |
import BASE_URL from '../../constants'; | |
const SelectType = (type, props, asyncProps) => { | |
const { | |
searchKey, |
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 axios from 'axios'; | |
import BASE_URL from './../constants'; | |
import { | |
showNotification, | |
} from '../utils/Notifications'; | |
function makeHeaders() { | |
let headerObj = {}; | |
if (JSON.parse(localStorage.getItem('user_info')) != null) { |
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
// This file merely configures the store for hot reloading. | |
// This boilerplate file is likely to be the same for each project that uses Redux. | |
// With Redux, the actual stores are in /reducers. | |
import promiseMiddleware from 'redux-promise-middleware'; | |
import { createStore, applyMiddleware, compose } from 'redux'; | |
import thunkMiddleware from 'redux-thunk'; | |
import rootReducer from './'; |
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 actionTypes from './actionTypes'; | |
const initialState = { | |
customers: [], | |
searchItem: '', | |
totalCustomers: 0, | |
currentPageNo: 1, | |
currentPageSize: 100, | |
selectedUsers: [], | |
loading: false, |
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
/* | |
<Input | |
type={String} | |
label={String} | |
placeholder={String} | |
name={String} | |
value={String} | |
onFocus={function} | |
onChange={function} |
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
/*! | |
* Dynamically changing favicons with JavaScript | |
* Works in all A-grade browsers except Safari and Internet Explorer | |
* Demo: http://mathiasbynens.be/demo/dynamic-favicons | |
*/ | |
// HTML5™, baby! http://mathiasbynens.be/notes/document-head | |
document.head || (document.head = document.getElementsByTagName('head')[0]); | |
function changeFavicon(src) { |
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
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
OlderNewer