ErrorToast

Type: React component

How to get ErrorToast?

JavaScript

import ErrorToast from 'fontoxml-feedback/src/ErrorToast.jsx'

Displays a given error with a certain recovery option inside a bordered and colored background. If error.recovery === RecoveryOption.ACKNOWLEDGEABLE || error.recovery === RecoveryOption.NONE it is displayed in error connotation colors (red), otherwise warning connotatation colors are used (orange). Displays an TextLink that executes the appropriate callback based on the error.recovery: RecoveryOption.ACKNOWLEDGEABLE uses onHideLinkClick, RecoveryOption.REFRESHABLE uses onRefreshLinkClick, RecoveryOption.RETRYABLE uses onRetryLinkClick.

Useful to display errors inline with form fields or other content.

Props

  1. error

    (Optional)

    Type: Object

    The error to visualize as an error toast. usually you do not create this object yourself, instead it is injected in one of your custom components by the system automatically, for you to pass along to this component.

    Static properties

  2. onHideLinkClick

    (Optional)

    Type: Function

    If error.recoveryOption === RecoveryOption.ACKNOWLEDGEABLE, this callback is called when the user clicks the rendered text link. Usually this is set to onReviewAnnotationErrorAcknowledge or onReplyErrorHide.

    Default value

  3. onRefreshLinkClick

    (Optional)

    Type: Function

    If error.recoveryOption === RecoveryOption.REFRESHABLE, this callback is called when the user clicks the rendered text link. Usually this is set to onReviewAnnotationRefresh or onReplyRefresh.

    Default value

  4. onRetryLinkClick

    (Optional)

    Type: Function

    If error.recoveryOption === RecoveryOption.RETRYABLE, this callback is called when the user clicks the rendered text link. Usually this is set to whatever was attempted at first that can now be retried, eg: onReviewAnnotationFormSubmit or onReplyFormSubmit.

    Default value