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'; | |
type BaseObject<ColorKey extends string, PercentKey extends string> = { | |
[key in ColorKey]: string; | |
} & | |
{ | |
[key in PercentKey]: number; | |
}; | |
function GenericListView< |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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 { Box, Flex } from "@chakra-ui/core"; | |
import _ from "lodash"; | |
import { useKey } from "react-use"; | |
import { motion } from "framer-motion"; | |
const MotionFlex = motion.custom(Flex); | |
const TILE_SIZE = 100; | |
const ROWS = 4; |
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'; | |
// Usage: useOnUnmount((deps) => console.log(deps), deps); | |
const useOnUnmount = (fn, deps) => { | |
const ref = React.useRef(text); | |
React.useEffect(() => { | |
ref.current = deps; | |
}, [deps]); |
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 { View } from 'react-native'; | |
import { flatMap, map } from 'lodash'; | |
import { utils } from '../theme'; | |
import Text from './Text'; | |
const InlineTextAndElements = (props) => { | |
const { children, containerProps, ...restProps } = props; |
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 { useState } from 'react'; | |
const useToggle = (initialState = false) => { | |
const [isActive, setIsActive] = useState(initialState); | |
const isInactive = !isActive; | |
const deactivate = () => setIsActive(false); | |
const activate = () => setIsActive(true); | |
const toggle = () => setIsActive(((value) => !value)); |
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
root = true | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
indent_size = 2 | |
indent_style = space | |
insert_final_newline = true | |
max_line_length = 120 | |
trim_trailing_whitespace = true |
NewerOlder