Newer
Older
CrypticOreWallet / src / layouts / dialogs / AddWalletDialog.tsx
@Drew Lemmy Drew Lemmy on 30 Sep 2020 1 KB feat: start of add wallet dialog
import React from "react";

import { useTranslation } from "react-i18next";

import { IconButton } from "@components/icon-button/IconButton";

import { ModalDialog, withDialogLink } from "./ModalDialog";

export const AddWalletButton = withDialogLink(
  (show, handleClose) => 
    <AddWalletDialog show={show} handleClose={handleClose} create={false} />
)(IconButton);

export const CreateWalletButton = withDialogLink(
  (show, handleClose) => 
    <AddWalletDialog show={show} handleClose={handleClose} create={true} />
)(IconButton);

interface Props {
  show: boolean;
  handleClose: () => void;

  /** If true, show the 'create wallet' dialog instead of the 'add wallet'
   * dialog. */
  create?: boolean;
}

export const AddWalletDialog: React.FC<Props> = ({ show, handleClose, create }: Props) => {
  const { t } = useTranslation();

  return <ModalDialog
    show={show}
    handleClose={handleClose}
    title={t(create ? "addWallet.dialogTitleCreate" : "addWallet.dialogTitle")}
  >
    Placeholder
  </ModalDialog>;
};