From e9326ae168701bd5879abb6c37ae477d44c80186 Mon Sep 17 00:00:00 2001 From: vivitt Date: Wed, 6 Mar 2024 10:43:14 +0100 Subject: [PATCH] conditionally render the ErrorMessage component --- src/components/ErrorMessage.css | 8 ---- src/components/ErrorMessage.jsx | 6 +-- src/views/Home.css | 3 ++ src/views/Home.jsx | 16 ++++--- src/views/ManageList.css | 3 ++ src/views/ManageList.jsx | 82 ++++++++++++++++++--------------- 6 files changed, 60 insertions(+), 58 deletions(-) diff --git a/src/components/ErrorMessage.css b/src/components/ErrorMessage.css index 3177e43..e69de29 100644 --- a/src/components/ErrorMessage.css +++ b/src/components/ErrorMessage.css @@ -1,8 +0,0 @@ -.errorMessage { - height: 5rem; -} - -p { - margin: 0; - padding: 0; -} diff --git a/src/components/ErrorMessage.jsx b/src/components/ErrorMessage.jsx index 10e7276..e0388d0 100644 --- a/src/components/ErrorMessage.jsx +++ b/src/components/ErrorMessage.jsx @@ -1,11 +1,7 @@ import './ErrorMessage.css'; const ErrorMessage = (props) => { - return ( -
- {props.errorMessage !== '' ?

{props.errorMessage}

: <>} -
- ); + return
{

{props.errorMessage}

}
; }; export default ErrorMessage; diff --git a/src/views/Home.css b/src/views/Home.css index e69de29..157069f 100644 --- a/src/views/Home.css +++ b/src/views/Home.css @@ -0,0 +1,3 @@ +.Home__form { + height: 8rem; +} diff --git a/src/views/Home.jsx b/src/views/Home.jsx index 14e87dd..ad228d9 100644 --- a/src/views/Home.jsx +++ b/src/views/Home.jsx @@ -12,13 +12,15 @@ export function Home({ data, setListPath, userId, userEmail }) {

Hello from the home (/) page!

- - +
+ + {message !== '' && } +
    {data.map((list, i) => ( +

    Hello from the /manage-list page!

    -
    - - - - -
    - - -
    -
    - - -
    - - +
    +
    + + + + +
    + {addItemErrMessage !== '' && ( + + )} +
    +
    +
    + + +
    + {shareListErrMessage !== '' && ( + + )} +
    +
    ); }