Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nandorojo/burnt
Browse files Browse the repository at this point in the history
  • Loading branch information
nandorojo committed May 8, 2023
2 parents d212965 + e327bb0 commit 29cbe1c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@

Cross-platform toasts for React Native, powered by native elements.

- [Install](#installation)
- [Usage](#api)

## Toasts

https://user-images.githubusercontent.com/13172299/202289223-8a333223-3afa-49c4-a001-a70c76150ef0.mp4

## Alerts

https://user-images.githubusercontent.com/13172299/231801324-3f0858a6-bd61-4d74-920f-4e77b80d26c1.mp4



## Context

See this
Expand All @@ -28,8 +39,19 @@ thanks to Expo's new module system.
rather than using React state with JS-based UI.
- Animated icons
- iOS App Store-like `alert` popups
- Overlays on top of native iOS modals, unlike JS-based solutions
(video)[https://twitter.com/FernandoTheRojo/status/1593632122069291008].
- Overlays on top of native iOS modals
- Loading alerts


## Modals

Displaying toasts on top of modals has always been an issue in React Native. With Burnt, this works out of the box.



https://user-images.githubusercontent.com/13172299/231801096-2894fbf3-4df7-45d7-9c72-f80d36fd45ef.mp4



## Usage

Expand Down Expand Up @@ -124,8 +146,6 @@ Be sure to follow the [expo](#expo) instructions too.

https://user-images.githubusercontent.com/13172299/202275423-300671e5-3918-4d5d-acae-0602160de252.mp4

_The API changed since recording this video. It now uses object syntax._

`toast(options): Promise<void>`

```tsx
Expand All @@ -136,9 +156,9 @@ Burnt.toast({

message: '', // optional

haptic: 'none' // or "success", "warning", "error"
haptic: 'none', // or "success", "warning", "error"

duration: 2 // duration in seconds
duration: 2, // duration in seconds

shouldDismissByDrag: true,

Expand All @@ -149,6 +169,7 @@ Burnt.toast({
iconSize: {
height: 24,
width: 24,
}
},
icon: {
ios: {
Expand All @@ -157,7 +178,6 @@ Burnt.toast({
color: "#1D9BF0",
},
},
},
})
```

Expand Down

0 comments on commit 29cbe1c

Please sign in to comment.