1import React, { useState, useRef } from 'react';
3import useInterval from 'lib/useInterval';
5// TODO: make these characters display as the same width
6export const LOADING_CHARACTER = '▓';
7export const INTERSTITIAL_CHARACTER = '░';
8const BLINK_AFTER_MS = 2500; // ms
10export const matchBlinky = obj =>
12 Nothing: () => <Blinky delayed />,
16export default function Blinky({
17 a = LOADING_CHARACTER,
18 b = INTERSTITIAL_CHARACTER,
21 const [value, setValue] = useState(true);
22 const now = useRef(new Date());
25 // only start blinking if we've elapsed enough time and want to delay
26 if (!delayed || new Date() - now.current > BLINK_AFTER_MS) {
27 setValue(val => !val);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list