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 { string, shape } from "prop-types"; | |
import es from "./messages_es"; | |
function I18n({ id, fallback, fillers }) { | |
const message = es[id] || fallback || id; | |
const filledMessage = fillMessage(message, fillers); | |
if(fillTagRegex.test(filledMessage)) { |
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 } from "prop-types"; | |
import styled from "styled-components"; | |
function Close({ className }) { | |
return ( | |
<svg className={className} viewBox="0 0 24 24"> | |
<path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /> | |
</svg> | |
); |
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, node } from "prop-types"; | |
import styled from "styled-components"; | |
import { ErrorMessage } from "formik"; | |
import I18n from "../I18n"; | |
const Optional = styled.i` | |
font-size: small; | |
`; |
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 { useEffect } from "react"; | |
/** | |
* Just like useEffect but it delays execution and debounces by the given delay | |
* | |
* @param {import("react").EffectCallback} effect | |
* @param {Number} delay | |
* @param {import("react").DependencyList} deps | |
*/ | |
export default function useDebounce(effect, delay, deps) { |
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 { createContext } from "react"; | |
const SessionContext = createContext(); | |
export function SessionProvider({ session, children }) { | |
return ( | |
<SessionContext.Provider value={session}> | |
{children} | |
</SessionContext.Provider> | |
); |
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, | |
useState, | |
useEffect, | |
useRef, | |
useCallback | |
} from "react"; | |
import { number } from "prop-types"; | |
import { Map, TileLayer, Marker } from "react-leaflet"; | |
import L from "leaflet"; |
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, { useCallback, useMemo } from "react"; | |
import { string, func, number } from "prop-types"; | |
import styled from "styled-components"; | |
import DefaultButton from "components/common/input/Button"; | |
import I18n from "components/common/I18n"; | |
import Dots from "components/common/icons/Dots"; | |
const Button = styled(DefaultButton)` | |
margin: 0 0.25rem; |
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 { | |
createElement, useState, useEffect, useCallback, | |
} from 'react'; | |
import { | |
oneOfType, instanceOf, number, elementType, | |
} from 'prop-types'; | |
function formatUnit (n) { | |
return Math.floor(n).toString().padStart(2, '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, { | |
useCallback, useState, useEffect, cloneElement, | |
} from 'react'; | |
import { findDOMNode } from 'react-dom'; | |
import { node, bool, number } from 'prop-types'; | |
import styled from 'styled-components'; | |
import usePrevious from 'hooks/usePrevious'; | |
const Collapsible = styled.div.attrs( |
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 { useRef, useEffect } from 'react'; | |
export default function usePrevious(value) { | |
const ref = useRef(); | |
useEffect(() => { | |
ref.current = value; | |
}, [value]); | |
return ref.current; | |
} |