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
| // generate-icons.ts | |
| /** | |
| * generate-icons.ts | |
| * | |
| * Run with: | |
| * deno run --allow-read --allow-write generate-icons.ts | |
| * | |
| * This version: | |
| * - Uses @svgr/core@6.5.1?bundle so that Deno pulls in the full SVGR runtime | |
| * - After SVGR transforms each SVG into TSX, runs Prettier (TypeScript parser) |
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' | |
| const Method = { | |
| GET: "GET", | |
| HEAD: "HEAD", | |
| POST: "POST" | |
| } | |
| const ReadyState = { | |
| UNSENT: 0, |
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, {useRef, useState, useEffect} from 'react' | |
| import {Key} from '../../../utils/keyboardUtils' | |
| export const useTab = () => { | |
| const [ reverse, setReverse ] = useState(null) | |
| useEffect(() => { | |
| const handleKeyDown = e => { | |
| let key = e.which || e.keyCode | |
| if (key === Key.TAB && e.shiftKey) { | |
| setReverse(true) |
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 const Key = { | |
| TAB: 9, | |
| ENTER: 13, | |
| SPACE: 32, | |
| END: 35, | |
| HOME: 36, | |
| LEFT: 37, | |
| UP: 38, |
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
| // other good ref: | |
| // https://medium.com/@kayodeniyi/setting-up-tests-for-react-using-mocha-expect-and-enzyme-8f53af96fe7e | |
| // example call: | |
| // mocha --reporter spec mochaTestSetup.js "components/*.spec.js" | |
| const jsdom = require('jsdom').jsdom | |
| process.env.NODE_ENV = 'test' | |
| // ------------------------------- |
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
Show hidden characters
| { | |
| "presets": [ | |
| [ "env", { "modules": false } ], | |
| "react", | |
| "stage-2" | |
| ], | |
| "env": { | |
| "test": { | |
| "presets": [ | |
| [ "env", { "targets": {"node": "current"} } ], |
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
| // HOW TO: | |
| // jest --config jest.config.js | |
| // -- assetsTransformer.js -- | |
| // const path = require('path'); | |
| // module.exports = { | |
| // process(src, filename, config, options) { | |
| // return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';'; | |
| // }, | |
| // }; |
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
| // EXAMPLE USE CASE: | |
| // ---------------- | |
| // Button.test.js | |
| // import React from 'react' | |
| // import Button from '../../src/common/input/Button' | |
| // import renderer from 'react-test-renderer' | |
| // import '../JestHelpers' | |
| // | |
| // describe('<Button/>', () => { | |
| // test('background style changes on mouse over/out events', () => { |
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' | |
| import ReactDOM from 'react-dom' | |
| import { Key } from '../utils/keyboardUtils' | |
| export default class FocusManager extends React.Component { | |
| constructor(props) { | |
| super(props) | |
| this._immediateID = null | |
| this.state = { |
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
| def mapStructure(Map map, int layer = 0) { | |
| map.each { key, value -> | |
| println "${('\t' * layer) + key}: ${layer.toString()}" | |
| if(value.getClass() == LinkedHashMap.class) { | |
| mapStructure((Map)value, layer+1) | |
| } | |
| } | |
| } | |
| // Example usage: |
NewerOlder