react-feather#Calendar TypeScript Examples

The following examples show how to use react-feather#Calendar. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Toolbar.tsx    From crypto-fees with MIT License 6 votes vote down vote up
DateButton = forwardRef<
  HTMLButtonElement,
  { onClick?: any; value?: string; loading?: boolean }
>(({ onClick, value, loading }, ref) => {
  const { t } = useTranslation();
  return (
    <Button ref={ref} onClick={onClick} Icon={Calendar}>
      {loading ? <div className="loader" /> : value || t('Yesterday')}

      <style jsx>{`
        .loader {
          display: inline-block;
          width: 20px;
          height: 20px;
          margin: 0 10px;
        }
        .loader:after {
          content: ' ';
          display: block;
          width: 16px;
          height: 16px;
          border-radius: 50%;
          border: 2px solid #333;
          border-color: #333 transparent #333 transparent;
          animation: lds-dual-ring 1.2s linear infinite;
        }
        @keyframes lds-dual-ring {
          0% {
            transform: rotate(0deg);
          }
          100% {
            transform: rotate(360deg);
          }
        }
      `}</style>
    </Button>
  );
})