Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(new): supports custom and without icon #12

Merged
merged 8 commits into from
Mar 3, 2023

Conversation

alantoa
Copy link
Contributor

@alantoa alantoa commented Mar 2, 2023

Why

burnt has not supported some features below:

  1. large text, now only supported one line of text. if you pass some long text will be omitted.
  2. custom ios icon, now only support error and done icon.
  3. hide icons, sometimes we need to hide icons.
  4. some parameters are not required but the ts type is required.

so I made this PR to support them.

How

update some ts type and improve the BurntModule.swift native module.

Test

CleanShot.2023-03-03.at.2.31.39.mp4

@nandorojo nandorojo changed the title Fix/imporve api Fix/improve api Mar 2, 2023
if(options.preset == .none){
view = SPIndicatorView(title: options.title, message: options.message)
} else if(options.preset == .custom){
view = SPIndicatorView(title: options.title, message: options.message, preset: options.preset.toSPIndicatorPreset(options)!)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's better to unwrap if the values with if let the way I did previously, instead of asserting with !.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that it has only two ways to init it, so I just sorted out the code style, I think this commit will be good!

CleanShot 2023-03-03 at 3 24 59

@alantoa alantoa changed the title Fix/improve api feat(new): supports custom and without icon Mar 3, 2023
@alantoa alantoa requested a review from nandorojo March 3, 2023 07:31
@alantoa
Copy link
Contributor Author

alantoa commented Mar 3, 2023

also, we need to handle a case when the icon is not found, so I just committed this to catch some edge case.

CleanShot.2023-03-03.at.5.21.30.mp4

README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@nandorojo
Copy link
Owner

Left some extra notes @alantoa. I think the icon.layout needs to get fixed to match the new ios.icon API. I left notes on how to fix.

@nandorojo
Copy link
Owner

Is it all tested & good to go?

@alantoa
Copy link
Contributor Author

alantoa commented Mar 3, 2023

@nandorojo yeah sure, I'm already using the patch file now!

@nandorojo nandorojo merged commit d7ac140 into nandorojo:master Mar 3, 2023
@nandorojo
Copy link
Owner

Published at 0.10. Release notes added as well.

@alantoa alantoa deleted the fix/imporve-notes branch March 3, 2023 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants