Skip to content

Instantly share code, notes, and snippets.

View MattBevis's full-sized avatar
🏠
Working from home

Matthew Bevis MattBevis

🏠
Working from home
View GitHub Profile
@MattBevis
MattBevis / useAxios.js
Created June 13, 2022 14:37
useAxios.js
/**
* This is the highest level hook for making HTTP requests. It's just a wrapper for basic HTTP requests.
*/
function useAxios() {
const [isLoading, setIsLoading] = React.useState(false);
const { getAccessTokenSilently } = useAuth0();
axios.defaults.baseURL = process.env.REACT_APP_BASE_URL;
const getRequest = async (url) => {
{
"Generate firebase environment variables": {
"prefix": "fireenv",
"body": [
"REACT_APP_FIREBASE_API_KEY=${1}",
"REACT_APP_FIREBASE_AUTH_DOMAIN=${2}",
"REACT_APP_FIREBASE_PROJECT_ID=${3}",
"REACT_APP_FIREBASE_STORAGE_BUCKET=${4}",
"REACT_APP_FIREBASE_MESSAGING_SENDER_ID=${5}",
"REACT_APP_FIREBASE_APP_ID=${6}"
const p = 250000 - (20 / 100) * 250000;
console.log('calcMonthlyRepayment -> p', p);
// monthly intrest
let i = (5 / 100 / 12).toFixed(6);
console.log('calcMonthlyRepayment -> i', i);
// number of periods (months)
let n = 30 * 12;
console.log('calcMonthlyRepayment -> n', n);
/* eslint-disable no-unneeded-ternary */
import React, { Component } from 'react';
import propTypes from 'prop-types';
import { withTheme } from 'styled-components';
import { connect } from 'react-redux';
import { Formik, ErrorMessage } from 'formik';
import Wizard from '../../../components/Wizard';
import { RegistrationContainer } from '../../../components/Containers';
import Headings from '../../../components/Headings';
import Input from '../../../components/Inputs/Text';