Skip to content

Instantly share code, notes, and snippets.

View omosehin's full-sized avatar

Abayomi Omosehin omosehin

  • Lagos Nigeria
View GitHub Profile
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Avatar from '@material-ui/core/Avatar';
import Button from '@material-ui/core/Button';
import CssBaseline from '@material-ui/core/CssBaseline';
import FormControl from '@material-ui/core/FormControl';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import LockOutlinedIcon from '@material-ui/icons/LockOutlined';
import Paper from '@material-ui/core/Paper';
@omosehin
omosehin / gist:faea61659c45a0f0a229d0cc5c10a8fd
Created January 31, 2019 13:01
User redirection(react and Springboot with jwt token)
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Avatar from '@material-ui/core/Avatar';
import Button from '@material-ui/core/Button';
import CssBaseline from '@material-ui/core/CssBaseline';
import FormControl from '@material-ui/core/FormControl';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Checkbox from '@material-ui/core/Checkbox';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import React, {Component} from "react";
// @material-ui/core components
import withStyles from "@material-ui/core/styles/withStyles";
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
import Paper from '@material-ui/core/Paper';
import Spinner from '../../components/Spinner'
@omosehin
omosehin / csv
Created February 5, 2019 08:33
import React, {Component} from "react";
// @material-ui/core components
import withStyles from "@material-ui/core/styles/withStyles";
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
import Paper from '@material-ui/core/Paper';
import Spinner from '../../components/Spinner'
import React, {Component} from "react";
import withStyles from "@material-ui/core/styles/withStyles";
import Input from "../../../../../components/Forms/Input"
import CardBody from "../../../../../components/Card/CardBody";
import Grid from '@material-ui/core/Grid';
import Select from "../../../../../components/Forms/Select"
import TextArea from "../../../../../components/Forms/TextArea"
import Button from "../../../../../components/Forms/Button"
import axios from "axios";
import Spinner from "../../../../../components/Spinner";
const{ voucherType, category, expirationDate,startDate,charset, amount, length, prefix, pattern, postfix,additionalInfo,separator,lengthPattern} = this.state.newUser;
const userData = {
voucherType, category, expirationDate,startDate,charset, amount, length, prefix, pattern, postfix,additionalInfo,separator,lengthPattern
}
console.log(userData);
const voucherData = JSON.stringify(userData)
console.log(voucherData);
// let user = JSON.parse(sessionStorage.getItem('data'));
// const token = user.data.id;
import React, { Component } from 'react';
import '../Admin.css';
import { Link } from 'react-router-dom';
import { Modal, ModalBody } from 'reactstrap';
import {fetchAllBlankcardsCus} from '../../../actions/OwnerActions/OwnerCardMgtActions/OwnerCardActions'
import { getTransactionsByCustomerForCDasboard, getSettlementsByCustomer } from '../../../actions/VendorActions/CustomerActions/CustomerActions';
import { fetchAllTrailByCustomer } from '../../../actions/OwnerActions/OwnerTrailMgtActions/OwnerTrailActions';
import { fetchCardsByCustomer, fetchAllCards } from '../../../actions/CustomerActions/CardMgtActions/CardAction';
import { loadAllCustomerVendors } from '../../../actions/CustomerActions/VendorMgtActions/VendorAction';
import { getAllUsers } from '../../../actions/customerUserActions';
@omosehin
omosehin / gist:5b9e12849f97582e5648dbac200c607b
Created April 13, 2019 22:04
AuthService where we have the end point
import { customConfig } from '../actions/action_constants';
import { authHeader } from '../helpers/authHeader';
export const vendorService = {
getAllVendors,
};
function getAllVendors() {
const requestOptions = {
import axios from "axios";
import { customConfig } from "../../action_constants";
import { authHeader } from "../../../helpers/authHeader";
const API_URL = customConfig.API_URL;
const API_URL_CARD = customConfig.API_URL_CARD;
const API_URL_REPORT = customConfig.API_URL_REPORT;
const API_URL_CARD_AND_TRANS = customConfig.API_URL_CARD_AND_TRANS;
export function fetchAllTrail(page,pageSize) {
return function(dispatch) {
validationRules = () => {
const emailRegex = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/;
const numRegex = /(0){1}(7|8|9){1}(0|1){1}[2-9]{1}\d{7}$/;
return {
firstName: (val) => val.length < 4 ? `First name must be longer than 3 letters!` : '',
lastName: (field) => field.length < 4 ? `Last name must be longer than 3 letters!` : '',
secret: (val) => val.length < 6 ? `Password length must be longer than 5!` : '',
userEmail: (val) => !emailRegex.test(val) ? "Valid email address is required!" : '',
phoneNumber: (val) => !numRegex.test(val) ? "Valid phone number is required!" : '',