Skip to content

Commit

Permalink
fix(company data): show error message in edit overlay (#1385)
Browse files Browse the repository at this point in the history
  • Loading branch information
manojava-gk authored Dec 2, 2024
1 parent 0fa665e commit f93b94f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export default function DetailsOverlay({
handleClose={handleClose}
open={edit}
handleConfirm={handleConfirm}
errorInfo={sharingStateErrorInfo}
/>
)}
</Box>
Expand Down
14 changes: 14 additions & 0 deletions src/components/pages/CompanyData/components/EditForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
type CompanyDataType,
useUpdateCompanySiteAndAddressMutation,
type CompanyDataFieldsType,
type SharingStateType,
} from 'features/companyData/companyDataApiSlice'
import { useSelector } from 'react-redux'
import {
Expand All @@ -53,6 +54,7 @@ interface FormDetailsProps {
readonly isAddress?: boolean
readonly handleConfirm: () => void
readonly newForm?: boolean
readonly errorInfo?: SharingStateType
}

export default function EditForm({
Expand All @@ -62,6 +64,7 @@ export default function EditForm({
isAddress = false,
newForm = false,
handleConfirm,
errorInfo,
}: FormDetailsProps) {
const { t } = useTranslation()
const [loading, setLoading] = useState<boolean>(false)
Expand Down Expand Up @@ -165,6 +168,17 @@ export default function EditForm({
}}
isAddress={isAddress}
/>
{errorInfo && (
<Typography
variant="body1"
sx={{
fontSize: '18px',
color: '#d32f2f',
}}
>
{errorInfo.sharingErrorMessage}
</Typography>
)}
</DialogContent>
<DialogActions>
<Button variant="outlined" onClick={handleClose}>
Expand Down

0 comments on commit f93b94f

Please sign in to comment.