How to use the react-countdown.zeroPad function in react-countdown

To help you get started, we’ve selected a few react-countdown examples, based on popular ways it is used in public projects.

github checktheroads / hyperglass / hyperglass / ui / components / CacheTimeout.js View on Github external
const Renderer = ({ hours, minutes, seconds, completed, props }) => {
  if (completed) {
    return <Text fontSize="xs" />;
  } else {
    let time = [zeroPad(seconds)];
    minutes !== 0 && time.unshift(zeroPad(minutes));
    hours !== 0 && time.unshift(zeroPad(hours));
    return (
      <Text fontSize="xs" color="gray.500">
        {props.text}
        <Text as="span" fontSize="xs" color={bg[props.colorMode]}>
          {time.join(":")}
        </Text>
      </Text>
    );
  }
};
github checktheroads / hyperglass / hyperglass / ui / components / CacheTimeout.js View on Github external
const Renderer = ({ hours, minutes, seconds, completed, props }) => {
  if (completed) {
    return <Text fontSize="xs" />;
  } else {
    let time = [zeroPad(seconds)];
    minutes !== 0 && time.unshift(zeroPad(minutes));
    hours !== 0 && time.unshift(zeroPad(hours));
    return (
      <Text fontSize="xs" color="gray.500">
        {props.text}
        <Text as="span" fontSize="xs" color={bg[props.colorMode]}>
          {time.join(":")}
        </Text>
      </Text>
    );
  }
};
github checktheroads / hyperglass / hyperglass / ui / components / CacheTimeout.js View on Github external
const Renderer = ({ hours, minutes, seconds, completed, props }) => {
  if (completed) {
    return <Text fontSize="xs" />;
  } else {
    let time = [zeroPad(seconds)];
    minutes !== 0 && time.unshift(zeroPad(minutes));
    hours !== 0 && time.unshift(zeroPad(hours));
    return (
      <Text fontSize="xs" color="gray.500">
        {props.text}
        <Text as="span" fontSize="xs" color={bg[props.colorMode]}>
          {time.join(":")}
        </Text>
      </Text>
    );
  }
};

react-countdown

A customizable countdown component for React.

MIT
Latest version published 1 year ago

Package Health Score

62 / 100
Full package analysis

Popular react-countdown functions