Skip to content

Commit

Permalink
docs: Add documentation for calling creation modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Merkur39 committed Apr 4, 2022
1 parent e1ad588 commit 512d2d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/cozy-mespapiers-lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ const MesPapiersView = props => {

export default MesPapiersView
```
# Call modal with URL
In your application, if you want to call a modal to create a Paper, you just have to call the `/paper/create` or `/paper/create/:qualificationLabel` route with the query parameter `backgroundPath=<currentPath>`
Exemple:
```jsx
const { pathname } = useLocation()

const handleClick = () => {
history.push({
pathname: `/paper/create`,
search: `backgroundPath=${pathname}`
})
}
```
## Development
Expand Down

0 comments on commit 512d2d0

Please sign in to comment.