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 { createAsyncThunk, AsyncThunkPayloadCreator, AsyncThunk } from '@reduxjs/toolkit'; | |
type DebounceSettings = { | |
/** | |
* The maximum time `payloadCreator` is allowed to be delayed before | |
* it's invoked. | |
* @defaultValue `0` | |
*/ | |
maxWait?: number; | |
/** |
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 { useWindowSize } from 'react-use'; | |
// 100vh is broken on mobile (Chrome, Safari): | |
// https://chanind.github.io/javascript/2019/09/28/avoid-100vh-on-mobile-web.html | |
export default function use100vh() { | |
const ref = React.useRef(); | |
const { height } = useWindowSize(); |
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
// Add on element with overflow | |
-webkit-mask-image: -webkit-radial-gradient(white, black); |
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
/** | |
* Convert an image | |
* to a base64 url | |
* @param {String} url | |
* @param {Function} callback | |
* @param {String} [outputFormat=image/png] | |
*/ | |
function convertImgToBase64URL(url, callback, outputFormat){ | |
var img = new Image(); | |
img.crossOrigin = 'Anonymous'; |