Skip to content

Commit

Permalink
perf(modal, portal): change to name export include portal
Browse files Browse the repository at this point in the history
- [x] switch to name export
- [x] allow to use portal
- [x] update dependencies
  • Loading branch information
AliKdhim87 committed Feb 19, 2022
1 parent a769f7b commit 0613e0e
Show file tree
Hide file tree
Showing 11 changed files with 27,247 additions and 5,753 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ package.json
.cache
public
lib
coverage
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
package.json
package-lock.json
public
lib
lib
coverage
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- CSS variables
- Accessibility
- FocusTrap
- Portal

## Installing

Expand All @@ -22,11 +23,13 @@ or
yarn add pretty-modal
```

> Note: below version 3 use default import `import Modal from 'pretty-modal'`
## Basic Example

```jsx
import React from 'react'
import Modal from 'pretty-modal'
import {Modal} from 'pretty-modal'

const App = () => {
const [isOpen, setIsOpen] = React.useState(false)
Expand Down Expand Up @@ -99,7 +102,7 @@ You can use the CSS variables for custom Style

```jsx
import React from 'react'
import Modal from 'pretty-modal'
import {Modal} from 'pretty-modal'

import './App.css'

Expand Down Expand Up @@ -151,7 +154,7 @@ export default App

```jsx
import React, {useState} from 'react'
import Modal from 'pretty-modal'
import {Modal} from 'pretty-modal'

const App = () => {
const [isLocked, setIsLocked] = useState(true)
Expand Down Expand Up @@ -216,6 +219,15 @@ export default App
</Modal>
```

## Portal

Use `<Portal/>` separately

```jsx
import {Portal} from 'pretty-modal'
;<Portal>Hello, World</Portal>
```

## Props

| Name | Type | Default | Description |
Expand Down
Loading

0 comments on commit 0613e0e

Please sign in to comment.