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 * as React from 'react' | |
import Table from '@material-ui/core/Table' | |
import TableBody from '@material-ui/core/TableBody' | |
import TableHead from '@material-ui/core/TableHead' | |
import TableRow from '@material-ui/core/TableRow' | |
import TableCell from '@material-ui/core/TableCell' | |
const ArrayOf = ({ type }) => ( | |
<React.Fragment> |
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
{ | |
"editor.fontFamily": "FiraCode-Light", | |
"editor.fontLigatures": true, | |
"window.zoomLevel": 4, | |
"prettier.printWidth": 140, | |
"prettier.semi": false, | |
"prettier.singleQuote": true, | |
"prettier.trailingComma": "all", | |
"editor.formatOnSave": true, | |
"workbench.iconTheme": "seti", |
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
type Method = 'get' | 'post' | 'put' | 'delete' | |
type Handler = (req: Request) => Promise<any> | |
function route (method: Method, path: string, handler: Handler) { | |
app[method](path, (req, res, next) => { | |
handler(req) | |
.then(result => result ? res.json(result) : res.status(204).end('')) | |
.catch(next) | |
}) | |
} |
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
function download(csv) { | |
if (csv == null) return | |
const filename = `export-${new Date()}.csv` | |
if (!csv.match(/^data:text\/csv/i)) { | |
csv = 'data:text/csv;charset=utf-8,' + csv | |
} | |
const data = encodeURI(csv) |
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
@red: #e51c23; | |
@red--50: #fde0dc; | |
@red--100: #f9bdbb; | |
@red--200: #f69988; | |
@red--300: #f36c60; | |
@red--400: #e84e40; | |
@red--500: #e51c23; | |
@red--600: #dd191d; | |
@red--700: #d01716; | |
@red--800: #c41411; |
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 * as React from "react"; | |
import { useMousePosition } from "~/hooks/useMousePosition"; | |
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */ | |
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) { | |
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {}; | |
const [mouseX, mouseY] = useMousePosition(); | |
const positions = { x, y, h, w, mouseX, mouseY }; | |
return ( | |
<div |
OlderNewer