Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
docs(ErrorLogger): capture error props
Browse files Browse the repository at this point in the history
Signed-off-by: irmerk <[email protected]>
  • Loading branch information
jolanglinais committed Aug 8, 2019
1 parent 651df27 commit 95e4e51
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 5 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ For using individual components in an app, refer to the individual component's R

Components ready for use:
- [`ContractEditor`][contracteditor]
- [`ErrorLogger`][errorlogger]
- [`TemplateLibrary`][templatelibrary]


Components still in development:
- [`ClauseEditor`][clauseeditor]
- [`ErrorLogger`][errorlogger]
- [`ParseResult`][parseresult]
- [`TemplateLoadingClauseEditor`][templateloadingclauseeditor]

Expand Down
56 changes: 53 additions & 3 deletions src/ErrorLogger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,64 @@
npm install @accordproject/cicero-ui
```

```
```js
import { ErrorLogger } from '@accordproject/cicero-ui';

const navigateToClauseError = // Insert your navigation function here.

const errorsPropsObject = {
ERRORS_HEADER_BACKGROUND (string),
ERRORS_HEADER_BACKGROUND_HOVER (string),
ERRORS_HEADER_EXPAND_ARROW (string),
ERRORS_HEADER_BORDER_TOP (string),
ERRORS_HEADER_SHADOW (string),
ERRORS_DISPLAY_BACKGROUND (string),
ERRORS_DISPLAY_SHADOW (string),
ERROR_BORDER_BOTTOM (string),
ERROR_EXPAND_ARROW (string),
ERROR_FILE (string),
ERROR_FILE_HOVER (string),
ERROR_TYPE (string),
ERROR_FULL_MESSAGE (string),
ERROR_SHORT_MESSAGE (string),
};

const ErrorContainer = props => (
<ErrorComponent errors={props.errors}/>
<ErrorLogger errors={props.errors} errorsProps={errorsPropsObject} errorNav={navigateToClauseError}/>
);
```

### Props

- `error` : An `array` which contains error objects.
#### Expected to be Provided

- `errors` : An `array` which contains error objects.

#### Require Provision

- `errorsProps` : An optional `object`, see below.
- `errorNav` : An optional `function` which will navigate to the corresponding error.

### Specifications

This component is built to have the following dimensions:

```js
width: '100%';
```

You can style the error component, as well as the individual errors. An object may be passed down this component with the following possible CSS inputs as strings:
- `ERRORS_HEADER_BACKGROUND`
- `ERRORS_HEADER_BACKGROUND_HOVER`
- `ERRORS_HEADER_EXPAND_ARROW`
- `ERRORS_HEADER_BORDER_TOP`
- `ERRORS_HEADER_SHADOW`
- `ERRORS_DISPLAY_BACKGROUND`
- `ERRORS_DISPLAY_SHADOW`
- `ERROR_BORDER_BOTTOM`
- `ERROR_EXPAND_ARROW`
- `ERROR_FILE`
- `ERROR_FILE_HOVER`
- `ERROR_TYPE`
- `ERROR_FULL_MESSAGE`
- `ERROR_SHORT_MESSAGE`

0 comments on commit 95e4e51

Please sign in to comment.