Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteMX committed Feb 8, 2022
1 parent 76575ef commit 2e29630
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ It uses the following libraries to do so:
- Upon clicking a link, you can let the widget decide what to do:
- If you select an Action, that will be used by the widget when you click any hyperlink
- If you do not select an Action, it will let the system handle it (e.g. open a link in a browser)
- Link Attribute can be used (preferably in a non-persistent Entity) to pass the link to your nanoflow. That way you have total control over what you do with any link
- Link Attribute can be used (preferably in a non-persistent Entity) to pass the link to your nanoflow. That way you have total control over what you do with any link.
- Note: Make sure the attribute and entity is editable. The widget will **not** give you an error when it is not editable.

## Styling

Expand Down Expand Up @@ -129,6 +130,32 @@ The widget's style properties are as follows:
| `json/container` | This has all ViewStyle properties | |
| `json/theme` | [base16 color scheme](https://github.com/chriskempson/base16) | [See this documentation](https://github.com/Dean177/react-native-json-tree#theming) |

## Example (with onClick Event)

Consider the following scenario:

1. We have a **non-persistent View** entity, which has two attributes: **Content** & **UrlClicked**

![](assets/example-01.png)

2. We configure the widget as follows:

![](assets/example-02a.png)

On click we execute a Nanoflow (IVK_ClickLink), which has the same View object as an input parameter. We also configure our Link Attribute to UrlClicked.

![](assets/example-02b.png)

3. Nanoflow

![](assets/example-03.png)

4. What happens?

- Let's say we have a text with `<p>This is a text with a <a href="link1">link</a></p>`. Notice the `href`
- The user clicks this link
- The widget will set the Link Attribute (in our example **UrlClicked**) to `link1`
- It will execute the **IVK_ClickLink** nanoflow, where we can retrieve the `href` contents (in this example `link1`) from the **UrlClicked** attribute

## Issues, suggestions and feature requests

Expand Down
Binary file added assets/example-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/example-02a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/example-02b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/example-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2e29630

Please sign in to comment.