From 68a80d403c4ee1c1c9af76ec4dacd3b58493bf98 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 8 Jul 2024 17:42:59 -0400 Subject: [PATCH 1/2] Added and tested ErrorText --- src/components/ErrorText/ErrorText.spec.tsx | 17 +++++++++++++++++ src/components/ErrorText/ErrorText.tsx | 7 +++++++ src/components/index.ts | 3 ++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/components/ErrorText/ErrorText.spec.tsx create mode 100644 src/components/ErrorText/ErrorText.tsx 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 From 3da41b8fc0fa65c241103fac3eacf77129fe180b Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 10 Jul 2024 10:23:45 -0400 Subject: [PATCH 2/2] Standardized Error Messages styling throughout app --- src/App.tsx | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) 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} - + )}