Newer
Older
CrypticOreWallet / src / layouts / dialogs / utils / CloseButton.tsx
@Drew Lemmy Drew Lemmy on 18 Sep 2020 585 bytes feat: i18n
import React from "react";

import { useTranslation } from "react-i18next";

import Button from "react-bootstrap/Button";

interface Props {
  handleClose: () => void;
  alignRight?: boolean;
}

export const CloseButton: React.FC<Props> = ({ handleClose, alignRight }: Props) => {
  const { t } = useTranslation();

  return (
    <Button 
      variant="secondary" 
      style={{ 
        marginRight: typeof alignRight === "undefined" || alignRight ? "auto" : "inherit" 
      }} 
      onClick={handleClose}
      tabIndex={1}
    >
      {t("dialog.close")}
    </Button>
  );
};