Skip to content

Instantly share code, notes, and snippets.

View johnrhampton's full-sized avatar
🎧

johnrhampton

🎧
View GitHub Profile
@johnrhampton
johnrhampton / cloudSettings
Last active January 31, 2021 15:02
OLD - vs code settings
{"lastUpload":"2021-01-27T16:22:06.205Z","extensionVersion":"v3.4.3"}
/**
* loading component styles
*/
.dissolve-animation.hide-remove {
display: inline !important;
}
.dissolve-animation.hide-remove,
.dissolve-animation.hide-add {
import React from 'react';
import classNames from 'classnames';
export default ({loading}) => {
let loading_class = classNames('dissolve-animation', {
'hide': !loading.show
});
let message_class = classNames('loading-overlay-message', {
/**
* LoadingOverlay component styles
*/
.loading-overlay .mdl-spinner {
height: 150px;
width: 150px;
}
.page-loading {
@johnrhampton
johnrhampton / index.ios.js
Created September 11, 2016 21:16
initial Dashboard component
import React, {Component} from 'react';
import {StyleSheet, TabBarIOS, Text, View} from 'react-native';
import {connect} from 'react-redux';
import Icon from 'react-native-vector-icons/Ionicons';
class Dashboard extends Component {
state = {
selected_tab: 'home',
render_count: 0
};
@johnrhampton
johnrhampton / recurse_function.js
Created September 9, 2016 19:46
recursive function
function doSomethingForAWhile() {
return new Promise((resolve, reject) => {
var maxStatusChecks = 10;
var statusCheckCount = 0;
var delay = 750;
(function doSomething() {
return checkSomethingAsync()
.then(() => {
return timeout(delay || 500);
@johnrhampton
johnrhampton / user.service.js
Created June 21, 2016 12:41
/common/services/user.service.js
'use strict';
import {post} from './http.service';
import {API_PATH, SOCKET_ID} from '../constants/environment.js';
import {USER} from '../constants/endpoints';
export function login(username, password, phoneExt) {
return new Promise(
(resolve, reject) => {
var url = API_PATH + USER.LOGIN;
@johnrhampton
johnrhampton / main.store.js
Created June 21, 2016 12:40
/common/stores/main.store.js
'use strict';
import {createStore, applyMiddleware, compose} from 'redux';
import thunkMiddleware from 'redux-thunk';
import createLogger from 'redux-logger';
import rootReducer from '../reducers';
import {ENV_TYPE} from '../constants/environment';
export let createStores = (initialState) => {
@johnrhampton
johnrhampton / user.reducer.js
Created June 21, 2016 12:37
/common/reducers/user.reducer.js
'use strict';
import {cloneDeep} from 'lodash';
import {
CHANGE_SITE_CONTEXT,
LEADS_PROFILE,
LOGIN_COMPLETE,
LOGIN_REQUEST,
LOGOUT_REQUEST,
@johnrhampton
johnrhampton / index.js
Created June 21, 2016 12:36
/common/reducers/index.js
'use strict';
import {combineReducers} from 'redux';
import admin_reducer from './admin';
import {dialer_reducer} from './dialer.reducer';
import {disposition_reducer} from './disposition.reducer';
import {lead_reducer} from './lead.reducer';
import {loading_reducer} from './loading.reducer';
import {navigation_reducer} from './navigation.reducer';