Follow @fernandotherojo
nandorojo / burnt Goto Github PK
View Code? Open in Web Editor NEWCrunchy toasts for React Native. ๐
License: MIT License
Crunchy toasts for React Native. ๐
License: MIT License
Follow @fernandotherojo
Would be great to have demos for iOS and Android.
Would also be great to have updated iOS Videos (as the syntax changed). Maybe just show the notification without code.
โ ๏ธ Something went wrong running `pod install` in the `ios` directory.
Command `pod install` failed.
โโ Cause: Error installing ASN1Decoder
[!] /usr/local/bin/git clone https://github.com/filom/ASN1Decoder.git /var/folders/p4/429v7kqd02n3c2qhrt0n94y40000gn/T/d20230114-47934-qn4xhk --template= --single-branch --depth 1 --branch 1.8.0
Cloning into '/var/folders/p4/429v7kqd02n3c2qhrt0n94y40000gn/T/d20230114-47934-qn4xhk'...
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Used the solito instructions found here: https://github.com/nandorojo/burnt#solito
but instead of cd'ing into applications/app
I went into apps/expo
(i am using a tamagui starter project), and i also tried manually going in to the ios
folder to pod install
with no luck (same error above).
@nandorojo you were thinking of something with radix-ux
Toast?
Alternatives:
This library doesn't support plain react-native, as root dependencies relies on expo module system, so it's impossible to use it with the plain react-native setup. Would be great if there will be possibility to install it to react-native project without expo
Android Icon can not be changed
Hi ! Thanks for the awesome library
Currently when triggering multiple toasts; one just stacks one of top of the other in the z-axis.
How could we trigger multiple to be stacked on the y-axis to stack vertically ?
thanks !
This is more of a feature request since I've found that the default shadow config applied by SPIndicator does not fit my use case. I don't know if SPIndicator exposes those parameters as configurable - if so, it would be nice to have the option to customize them, similar to how you can do so with regular react native View. This might be easier to do when Expo adds support for using SwiftUI views within the modules
Had these alerts hooked up and working which is why this is odd to me but getting fastlane build errors during my eas build phase for my expo app.
(ios/Pods/SPAlert/Sources/AlertKit/Views/AlertAppleMusic16View.swift:19:5)
17 | default: UIColor(red: 88 / 255, green: 87 / 255, blue: 88 / 255, alpha: 1)
18 | }
> 19 | }
| ^ missing return in closure expected to return 'UIColor'
20 |
21 | fileprivate weak var viewForPresent: UIView?
22 | fileprivate var presentDismissDuration: TimeInterval = 0.2
โ (ios/Pods/SPAlert/Sources/AlertKit/Views/AlertAppleMusic17View.swift:19:5)
17 | default: UIColor(red: 88 / 255, green: 87 / 255, blue: 88 / 255, alpha: 1)
18 | }
> 19 | }
| ^ missing return in closure expected to return 'UIColor'
20 |
21 | fileprivate weak var viewForPresent: UIView?
22 | fileprivate var presentDismissDuration: TimeInterval = 0.2
To make sure it was this libray, i had to remove burnt
. Once i did was able to build again successfully.
"burnt": "^0.11.7",
"expo": "^49.0.0",
"react-native": "0.72.5",
Followed the docs as well to get it working in Expo and like I said had it working and already made builds through EAS just fine.
I do have some code now that updates Appearance
manually with Appearance.setColorScheme()
-> I need this as my users can set their color mode to match the OS or be light & dark. If they select light or dark and the match os is toggled off, then native components did not update, so i added the Appearance.setColorScheme(light | dark | null) to match which works with things like Alert
from RN, it also worked on development builds for your burnt alerts & toasts as well but been running into the error above trying to build new builds through EAS.
thank you for this great lib.
but it's better to add more options for styling.
Bring more performance to the library, buuut... reanimated must be a lib dep. It's a problem?
Hi, I tried to use this library in a bare React Native (non-expo) project to no avail. I basically did:
yarn add burnt
(cd ios && bundle exec pod install)
yarn ios
Upon launch, a redbox appears, saying
Unable to resolve module expo-modules-core from /Users/myusername/Projects/myproject/node_modules/burnt/build/BurntModule.ios.js: expo-modules-core could not be found within the project or in these directories:
node_modules/burnt/node_modules
node_modules
> 1 | import { requireNativeModule } from 'expo-modules-core';
^
2 | // It loads the native module object from the JSI or falls back to
3 | // the bridge module (from NativeModulesProxy) if the remote debugger is on.
These are cool too: https://github.com/BastiaanJansen/toast-swift
I just noticed in code return BurntModule.toastAsync({ duration, ...options });
it seems ok for the web, but BurntModule
does not have a toastAsync
method on iOS.
Getting this error after upgrading to 0.12.2: index.ts:21 [burnt] toast() error: You need to add the <Toaster /> component to the root of your app for toasts to display on Web. There was no <Toaster /> found.
I flipped back to 0.12.1, and the error went away and toasts started working again. I definitely have a toaster in my root layout file app/layout.tsx
(using app router in nextjs 14.0.3).
Find this really weird because #33 didn't change a whole lot.
I know the library uses sonner under the hood for web but it seems I can't configure toast individually.
I'm able to import the library as indicated here and able to see the toast working as expected.
However, it seems this is the only accessible place where you'd add props for styling.
Is there a way to configure toasts across the application without using the global toast?
Add a license. https://choosealicense.com/
For new version added more styles. Good to integrate it as well.
If need any help let me know I happy to assist.
Version 0.9.0 was working just fine, the issue appeared in the last one.
React Native: 0.68.0
I checked the Swift version used on the project's build settings and it is Swift 5
The last two lines disappeared after I remove the node modules and pods, then reinstall them and clean the build folder using Xcode, but the Cannot find type 'Enumerable' in scope
it's still there.
I would like to have the functionality to set the text alignment, we could add this as a property in the layout object, if we think its a good idea i am happy to contribute the code
Hello. Thanks for this awesome library. Is it possible for the toast message to be multiline instead of truncated text?
Would you be open to integrate (PR or just issue feature request) a feature to trigger code to be run once the alert or toast is dismissed or timed out?
When it comes to helping out with a PR, would exposing the promise from BurntModule's async methods be enough, or would you prefer some onDismissed callback?
Tried installing this in an Expo Managed project, already using multiple packages that need pre building, without luck. Seems like it can't find the native module for some reason.
I tried the following:
Am I missing something?
Hey, I just wanted to put a suggestion out there: Could you implement the IOS Alert style for Android instead of using toast styles that come from the button? The suggestion has been implemented for Ting.
Hmm, I'm getting
Unable to resolve "sonner" from "node_modules/burnt/build/web.js"
I have installed sonner
, even tried an older version of it.
I'm running an Expo 49 project.
export default {
plugins: [
[
"expo-build-properties",
{
ios: {
deploymentTarget: "13.0",
},
},
],
],
};
I'm using app.json
and have expo tools
vscode extension running
Getting a warning of Incorrect type. Expected one of string.
Currently running expo 48 with create tamagui
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.