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
/** replaceJSX | |
* RegExp search text and replace with JSX | |
* @see https://stackoverflow.com/a/63647844 | |
* @param {string} str | |
* @param {RegExp} find | |
* @param {JSX} replace | |
* @returns {JSX} | |
*/ | |
export default function replaceJSX(str, find, replace) { | |
const parts = str.split(find); |
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
/** CloseConfirm.module.scss - Animated x → ✓ | |
* @see https://codepen.io/gdibble/pen/LYePYXL | |
* @example <button className={styles.CloseConfirm} type="button" onClick={someFn}><div className="check"> </div></button> | |
*/ | |
$SkyBlue100: #08b2e3; | |
.CloseConfirm { | |
position: absolute; | |
top: 0.25em; |
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
/** isMobile - Feature Detection of an actual mobile device | |
* @description The localStorage.mobile works in Chrome mobile; the latter works in Safari mobile. | |
* Does not trigger desktop browsers with or w/o the dev-tools open and/or on a mobile simulator. | |
* @see https://stackoverflow.com/questions/11381673/detecting-a-mobile-browser/71030087#71030087 | |
*/ | |
const isMobile = localStorage.mobile || window.navigator.maxTouchPoints > 1; |
OlderNewer