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, { Component } from 'react'; | |
import { Consumer } from '../../context'; | |
import TextInputGroup from '../../components/layout/TextInputGroup'; | |
import uuid from 'uuid'; | |
class AddContact extends Component { | |
state = { | |
name: '', | |
email: '', | |
phone: '', |
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
# OS X | |
.DS_Store* | |
Icon? | |
._* | |
# Windows | |
Thumbs.db | |
ehthumbs.db | |
Desktop.ini |
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'; | |
export default () => { | |
return ( | |
<div className="call mt-5 w-10 ml-7"> | |
<div className="call-box-top"> | |
<div className="call-phone"> | |
<form | |
name="contact-form" | |
method="post" |
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
version: '3.3' | |
services: | |
db: | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
restart: always | |
environment: | |
MYSQL_ROOT_PASSWORD: somewordpress |
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 '~bootstrap/scss/bootstrap.scss'; | |
@import 'default.css'; | |
/* Box sizing rules */ | |
*, | |
*::before, | |
*::after { | |
box-sizing: border-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
import { useEffect, useRef, useState } from "react"; | |
const useDebounce = (value, fn, duration) => { | |
const timeoutRef = useRef(setTimeout(() => undefined)); | |
const [settled, setSettled] = useState(true); | |
const [numDebounces, setNumDebounces] = useState(-1); | |
useEffect(() => { | |
setNumDebounces((num: number) => num + 1); | |
if (numDebounces <= 0) return; // prevents initially unsettled output on component mount... |
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 { useEffect, useRef, useState } from "react"; | |
const useDebounce = (value, fn, duration) => { | |
const timeoutRef = useRef(setTimeout(() => undefined)); | |
const [settled, setSettled] = useState(true); | |
const [numDebounces, setNumDebounces] = useState(-1); | |
useEffect(() => { | |
setNumDebounces((num) => num + 1); | |
if (numDebounces <= 0) return; // prevents initially unsettled output on component mount... |
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 { useEffect } from "react"; | |
export default (target = window, type, listener, ...options) => { | |
// console.table({ target, type, ...options }); | |
// console.log("useListener Ran", type, target); | |
useEffect(() => { | |
const targetIsRef = target.hasOwnProperty("current"); | |
const currentTarget = targetIsRef ? target.current : target; | |
// console.debug("useListener Effect", currentTarget, targetIsRef); | |
if (currentTarget) |
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 { useState, useEffect } from "react"; | |
export default function(targetKey, element = window, cb) { | |
const [keyPressed, setKeyPressed] = useState(false); | |
function downHandler(e) { | |
const { key } = e; | |
if (key === targetKey) { | |
setKeyPressed(true); | |
cb && cb() |
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 function debounce(func, wait = 20, immediate = true) { | |
var timeout; | |
return function() { | |
var context = this, | |
args = arguments; | |
var later = function() { | |
timeout = null; | |
if (!immediate) func.apply(context, args); | |
}; | |
var callNow = immediate && !timeout; |