-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Update vanilla example to use the modal step builder
- Loading branch information
1 parent
0581ab8
commit 8fe1ebc
Showing
7 changed files
with
71 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@frak-labs/nexus-sdk": patch | ||
--- | ||
|
||
Add a `modalBuilder` to ease modal creation |
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 |
---|---|---|
@@ -1,29 +1,13 @@ | ||
import { loginModalStep } from "./config"; | ||
|
||
export function modalShare() { | ||
const finalAction = { | ||
key: "sharing", | ||
options: { | ||
popupTitle: "Share this article with your friends", | ||
text: "Discover this awesome article", | ||
link: typeof window !== "undefined" ? window.location.href : "", | ||
}, | ||
} as const; | ||
if (!window.FrakSetup.frakClient) { | ||
if (!window.FrakSetup.modalBuilder) { | ||
console.error("Frak client not initialized"); | ||
return; | ||
} | ||
window.NexusSDK.displayModal(window.FrakSetup.frakClient, { | ||
metadata: { | ||
lang: "fr", | ||
isDismissible: true, | ||
}, | ||
steps: { | ||
login: loginModalStep, | ||
openSession: {}, | ||
final: { | ||
action: finalAction, | ||
}, | ||
}, | ||
}); | ||
window.FrakSetup.modalBuilder | ||
.sharing({ | ||
popupTitle: "Share this article with your friends", | ||
text: "Discover this awesome article", | ||
link: typeof window !== "undefined" ? window.location.href : "", | ||
}) | ||
.display(); | ||
} |
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