See Usage here https://gist.github.com/SebastianHGonzalez/b440178f7f771e2930fa00974bc7176c
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 styled from "styled-components"; | |
/** | |
* Copyright 2019 Sebastian Gonzalez | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
* | |
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
* |
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
const arrayReducer = (arr, elemnt) => arr.concat(elemnt) | |
arrayReducer.baseCase = [] | |
const stringReducer = (string, string2) => string + string2 | |
stringReducer.baseCase = "" | |
const functionReducer = (value, f) => f(value) | |
const mapTransducer = (f) => (reducer) => (acc, curr) => reducer(acc, f(curr)) | |
const filterTransducer = (f) => (reducer) => (acc, curr) => f(curr) ? reducer(acc, curr) : acc |
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, { useState, useCallback } from "react"; | |
import { func } from "prop-types"; | |
import { connect } from "react-redux"; | |
import useHistory from "./useHistory"; | |
import FirstStep from "./FirstStep"; | |
import SecondStep from "./SecondStep"; | |
import ThirdStep from "./ThirdStep"; | |
import FlowTransition from "./FlowTransition"; |
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, { useMemo } from "react"; | |
import { Spring, animated } from "react-spring/renderprops"; | |
import { interpolate } from "flubber"; | |
import { string, arrayOf, number } from "prop-types"; | |
export default function MorphPath({ paths, currentPath, id, fill, transform, scale }) { | |
const interpolators = useMemo( | |
// https://reactjs.org/docs/hooks-reference.html#usememo | |
() => | |
paths.map((path, index, array) => |
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 { string, bool, func } from "prop-types"; | |
import styled from "styled-components"; | |
const Input = styled.input` | |
display: none; | |
`; | |
const Slider = styled.span` | |
position: absolute; |
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 { string, bool } from "prop-types"; | |
import styled from "styled-components"; | |
import { Collapse } from "react-collapse"; | |
const Legend = styled.legend` | |
display: flex; | |
width: 100%; | |
justify-content: space-between; | |
`; |
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 styled from "styled-components"; | |
import font from "styled/font"; | |
export const Table = styled.table` | |
border-collapse: collapse; | |
background: ${({ theme }) => theme.table.head.background}; | |
`; |
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 styled from "styled-components"; | |
import Modal from "react-modal"; | |
import { desktop, mobile } from "styled/media"; | |
const StyledModal = styled(Modal)` | |
${mobile` | |
position: absolute; | |
top: 0; | |
left: 0; | |
right: 0; |