diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 5be931a..f56ae50 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -92,6 +92,11 @@ "columnTime": "Time" }, + "addWallet": { + "dialogTitle": "Add wallet", + "dialogTitleCreate": "Create wallet" + }, + "credits": { "madeBy": "Made by <1>{{authorName}}", "supportersTitle": "Supporters", diff --git a/src/app/App.tsx b/src/app/App.tsx index 09695ac..31a1c86 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -8,7 +8,7 @@ import { createStore } from "redux"; import { Provider } from "react-redux"; -import { devToolsEnhancer } from 'redux-devtools-extension'; +import { devToolsEnhancer } from "redux-devtools-extension"; import rootReducer from "@/src/store/reducers/RootReducer"; export const store = createStore( diff --git a/src/layouts/dialogs/AddWalletDialog.tsx b/src/layouts/dialogs/AddWalletDialog.tsx new file mode 100644 index 0000000..aec3480 --- /dev/null +++ b/src/layouts/dialogs/AddWalletDialog.tsx @@ -0,0 +1,38 @@ +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) => + +)(IconButton); + +export const CreateWalletButton = withDialogLink( + (show, handleClose) => + +)(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 = ({ show, handleClose, create }: Props) => { + const { t } = useTranslation(); + + return + Placeholder + ; +}; diff --git a/src/layouts/dialogs/HelpWalletStorageDialog.tsx b/src/layouts/dialogs/HelpWalletStorageDialog.tsx index 4d3420d..47dd260 100644 --- a/src/layouts/dialogs/HelpWalletStorageDialog.tsx +++ b/src/layouts/dialogs/HelpWalletStorageDialog.tsx @@ -1,33 +1,25 @@ -import React, { useState, MouseEvent } from "react"; +import React, { Component, ReactNode } from "react"; -import { useTranslation } from "react-i18next"; +import { useTranslation, WithTranslation, withTranslation } from "react-i18next"; -import { ModalDialog } from "./ModalDialog"; +import { WithDialogLink, withDialogLink, ModalDialog } from "./ModalDialog"; -export const HelpWalletStorageLink: React.FC = () => { - const { t } = useTranslation(); - const [show, setShow] = useState(false); +class HelpWalletStorageLinkComponent extends Component { + render(): ReactNode { + const { t, openDialog } = this.props; + return + {t("masterPassword.learnMore")} + ; + } +} - // Help dialog show/close state is essentially handled by the link - const handleClose = () => setShow(false); - const handleShow = (e: MouseEvent) => { - e.preventDefault(); - setShow(true); - }; - - return ( - <> - {/* Add a link to show the dialog */} - {/* TODO: make this a + } filters={<> {/* Search filter textbox */} diff --git a/src/shared-components/icon-button/IconButton.tsx b/src/shared-components/icon-button/IconButton.tsx index 0864262..6acf0ff 100644 --- a/src/shared-components/icon-button/IconButton.tsx +++ b/src/shared-components/icon-button/IconButton.tsx @@ -4,13 +4,14 @@ import "./IconButton.scss"; -interface Props extends ButtonProps { - icon: string; +export interface Props extends ButtonProps { + icon?: string; + openDialog?: () => void; } -export const IconButton: React.FC = (props: PropsWithChildren) => { - return ; };