Skip to content

Commit

Permalink
used utility function for handle alert component issue
Browse files Browse the repository at this point in the history
Signed-off-by: pranalidhanavade <[email protected]>
  • Loading branch information
pranalidhanavade committed Oct 9, 2024
1 parent 5ae23c2 commit 72138b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/User/UserDashBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const UserDashBoard = () => {
const [message, setMessage] = useState<string | null>('');
const [ecoMessage, setEcoMessage] = useState<string | null>('');
const [viewButton, setViewButton] = useState<boolean>(false);
const [error, setError] = useState<string >('');
const [error, setError] = useState<string | null>('');
const [currentPage, setCurrentPage] = useState(initialPageState);
const [organizationsList, setOrganizationList] =
useState<Array<Organisation> | null>(null);
Expand Down Expand Up @@ -461,7 +461,7 @@ const UserDashBoard = () => {
<div className="cursor-pointer">
{(error || message) && (
<AlertComponent
message={message || error || ''}
message={message}
type={message ? 'warning' : 'failure'}
viewButton={viewButton}
path={pathRoutes.users.invitations}
Expand All @@ -476,7 +476,7 @@ const UserDashBoard = () => {
<div className="cursor-pointer">
{(error || ecoMessage) && (
<AlertComponent
message={ecoMessage || error || ''}
message={ecoMessage}
type={ecoMessage ? 'warning' : 'failure'}
viewButton={viewButton}
path={`${envConfig.PUBLIC_ECOSYSTEM_FRONT_END_URL}${pathRoutes.users.dashboard}`}
Expand Down

0 comments on commit 72138b0

Please sign in to comment.