From 2e0e46fee0935df3fb9342ed8f5391f945d7a12f Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 10 Jul 2024 11:28:23 -0400 Subject: [PATCH] Merge pull request #6 from Skidragon/error-messages All Error messages are red. --- src/App.tsx | 23 ++++++++------------- src/components/ErrorText/ErrorText.spec.tsx | 17 +++++++++++++++ src/components/ErrorText/ErrorText.tsx | 7 +++++++ src/components/index.ts | 3 ++- 4 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 src/components/ErrorText/ErrorText.spec.tsx create mode 100644 src/components/ErrorText/ErrorText.tsx diff --git a/src/App.tsx b/src/App.tsx index 7af3d2a..38f6425 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -41,7 +41,7 @@ import { } from "./App-styles"; import { Spacer } from "./common/Spacer"; import { Loader } from "./components/Loader"; -import { PasswordField } from "./components"; +import { PasswordField, ErrorText } from "./components"; type extStates = | "not-authenticated" @@ -805,12 +805,7 @@ function App() { /> - {sendPaymentError} + {sendPaymentError} {/* {sendPaymentSuccess} */} - {sendPaymentError} + {sendPaymentError} )} {extState === "web-app-request-connection" && ( @@ -1073,9 +1068,9 @@ function App() { Authenticate - + {walletToBeDecryptedError} - + )} @@ -1144,9 +1139,9 @@ function App() { Confirm password - + {walletToBeDownloadedError} - + )} @@ -1229,9 +1224,9 @@ function App() { Create Account - + {walletToBeDownloadedError} - + )} diff --git a/src/components/ErrorText/ErrorText.spec.tsx b/src/components/ErrorText/ErrorText.spec.tsx new file mode 100644 index 0000000..bc098ea --- /dev/null +++ b/src/components/ErrorText/ErrorText.spec.tsx @@ -0,0 +1,17 @@ +import { + describe, + expect, + test +} from 'vitest'; +import { render } from '@testing-library/react' +import { + ErrorText +} from './ErrorText' + + +describe('ErrorText', () => { + test('it renders with the text', () => { + const { queryByTestId } = render(An Error has occured!) + expect(queryByTestId('test-id')?.textContent).toEqual('An Error has occured!') + }) +}) \ No newline at end of file diff --git a/src/components/ErrorText/ErrorText.tsx b/src/components/ErrorText/ErrorText.tsx new file mode 100644 index 0000000..cc3d458 --- /dev/null +++ b/src/components/ErrorText/ErrorText.tsx @@ -0,0 +1,7 @@ +import { Typography, TypographyProps, } from "@mui/material"; + +export const ErrorText: React.FunctionComponent = ({ ...props }) => { + return ( + + ) +} \ No newline at end of file diff --git a/src/components/index.ts b/src/components/index.ts index 1d947d7..4764f6c 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1 +1,2 @@ -export * from './PasswordField/PasswordField'; \ No newline at end of file +export * from './PasswordField/PasswordField'; +export * from './ErrorText/ErrorText'; \ No newline at end of file