Skip to content

Commit

Permalink
Merge pull request #12 from alantoa/fix/imporve-notes
Browse files Browse the repository at this point in the history
feat(new): supports custom and without icon
  • Loading branch information
nandorojo authored Mar 3, 2023
2 parents ce5434a + ed494bb commit d7ac140
Show file tree
Hide file tree
Showing 5 changed files with 265 additions and 109 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ You can also `Burnt.alert()` and `Burnt.dismissAllAlerts()`.

- [x] iOS support
- [x] Android support
- [x] Custom iOS icons
- [ ] Web support (could be cool to use Radix UI...but maybe I'll leave that
part up to Zeego)
- [ ] Custom iOS icons

Chances are, I'll keep this lib to iOS & Android only, and then another library
can consume it to build a broader API out on the JS side with Web support, such
Expand Down Expand Up @@ -132,7 +132,7 @@ _The API changed since recording this video. It now uses object syntax._
Burnt.toast({
title: 'Congrats!', // required

preset: 'done', // or "error"
preset: 'done', // or "error", "none", "custom"

message: '', // optional

Expand All @@ -149,9 +149,14 @@ Burnt.toast({
iconSize: {
height: 24,
width: 24,
},
icon: {
ios: {
// SF Symbol. For a full list, see https://developer.apple.com/sf-symbols/.
name: "checkmark.seal",
color: "#1D9BF0",
},

// TODO: custom SF Symbols...
},
},
})
```
Expand All @@ -171,7 +176,7 @@ export const alert = () => {
Burnt.alert({
title: "Congrats!", // required

preset: "done", // or "error", "heart"
preset: "done", // or "error", "heart", "custom"

message: "", // optional

Expand All @@ -183,7 +188,13 @@ export const alert = () => {
height: 24,
width: 24,
},
// TODO: custom SF Symbols...
},
icon: {
ios: {
// SF Symbol. For a full list, see https://developer.apple.com/sf-symbols/.
name: "checkmark.seal",
color: "#1D9BF0",
},
},
});
};
Expand Down
49 changes: 49 additions & 0 deletions example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@ export default function App() {
Loading Alert
</Text>

<View style={{ height: 16 }} />
<Text
style={[styles.text, styles.yellow]}
onPress={async () => {
Burnt.alert({
title: "Verified account",
preset: "custom",
icon: {
ios: {
name: "checkmark.seal",
color: "#1D9BF0",
},
},
});
}}
>
Custom Icon Alert
</Text>

<View style={{ height: 16 }} />

<Text
Expand Down Expand Up @@ -86,6 +105,36 @@ export default function App() {
>
Success Toast
</Text>
<View style={{ height: 16 }} />
<Text
style={[styles.text, styles.blue]}
onPress={async () => {
Burnt.toast({
title: "This is a large text and without icon toast!!!",
preset: "none",
});
}}
>
Without Icon Toast
</Text>
<View style={{ height: 16 }} />
<Text
style={[styles.text, styles.blue]}
onPress={async () => {
Burnt.toast({
title: "This is a large text and custom icon toast!!!",
preset: "custom",
icon: {
ios: {
name: "sparkle",
color: "#F7A51D",
},
},
});
}}
>
Custom Icon Toast
</Text>
</>
);

Expand Down
Loading

0 comments on commit d7ac140

Please sign in to comment.