-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into option-core-changes
- Loading branch information
Showing
4 changed files
with
103 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@react.component | ||
let make = (~showModal, ~setShowModal, ~text) => { | ||
<UIUtils.RenderIf condition={showModal}> | ||
<Modal | ||
showModal | ||
setShowModal | ||
modalClass="w-80 !h-56 flex items-center justify-center m-auto" | ||
paddingClass="" | ||
childClass="flex items-center justify-center h-full w-full"> | ||
<div className="flex flex-col items-center gap-2"> | ||
<Loader /> | ||
<div className="text-xl font-semibold mb-4"> {text->React.string} </div> | ||
</div> | ||
</Modal> | ||
</UIUtils.RenderIf> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Pollyfill for Promise.allSettled() | ||
// Promise.allSettled() takes an iterable of promises and returns a single promise that is fulfilled with an array of promise settlement result | ||
|
||
let allSettledPolyfill = (arr: array<promise<Js.Json.t>>) => { | ||
arr | ||
->Array.map(promise => | ||
promise | ||
->Promise.then(val => { | ||
Promise.resolve(val) | ||
}) | ||
->Promise.catch(err => { | ||
switch err { | ||
| Js.Exn.Error(e) => | ||
let err = Js.Exn.message(e)->Belt.Option.getWithDefault("Failed to Fetch!") | ||
err->Js.Json.string | ||
| _ => Js.Json.null | ||
}->Promise.resolve | ||
}) | ||
) | ||
->Promise.all | ||
} |