-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3526d2
commit 44d8cc1
Showing
4 changed files
with
55 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,26 @@ | ||
@react.component | ||
let make = () => { | ||
let loaderUI = | ||
let (branding, setBranding) = React.useState(_ => "auto") | ||
|
||
React.useEffect0(() => { | ||
Utils.handlePostMessage([("iframeMountedCallback", true->JSON.Encode.bool)]) | ||
let handle = (ev: Window.event) => { | ||
let json = ev.data->JSON.parseExn | ||
let dict = json->Utils.getDictFromJson | ||
setBranding(_ => dict->Utils.getDictFromDict("options")->Utils.getString("branding", "auto")) | ||
} | ||
Window.addEventListener("message", handle) | ||
Some(() => {Window.removeEventListener("message", handle)}) | ||
}) | ||
|
||
let styles = | ||
branding === "auto" | ||
? "backdrop-blur-md bg-black/80" | ||
: "backdrop-contrast-125 backdrop-blur-2xl opacity-70 bg-black/80" | ||
|
||
<div className={`h-screen w-screen flex m-auto items-center ${styles}`}> | ||
<div className={`flex flex-col justify-center m-auto visible`}> | ||
<Loader /> | ||
<Loader branding /> | ||
</div> | ||
<div className="h-screen w-screen bg-black/80 flex m-auto items-center backdrop-blur-md"> | ||
{loaderUI} | ||
</div> | ||
} |
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