Skip to content

Commit

Permalink
Merge pull request #11 from phantom/napas/add-zindex-to-sdk
Browse files Browse the repository at this point in the history
chore: Add z-index
  • Loading branch information
tian000 authored Nov 8, 2024
2 parents 5dae3a2 + 3d33130 commit ae732ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/pink-rice-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@phantom/wallet-sdk": patch
---

Add zindex argument
10 changes: 9 additions & 1 deletion packages/sdk/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { SDK_URL } from "./constants.js";

export function createPhantom() {
type CreatePhantomConfig = Partial<{
zIndex: number
}>

export function createPhantom(config: CreatePhantomConfig = {}) {
const container = document.head || document.documentElement;
const scriptTag = document.createElement("script");

const sdkURL = new URL(SDK_URL);
if (config.zIndex) sdkURL.searchParams.append("zIndex", config.zIndex.toString())

scriptTag.setAttribute("type", "module");
scriptTag.setAttribute("src", SDK_URL);
container.insertBefore(scriptTag, container.children[0]);
Expand Down

0 comments on commit ae732ca

Please sign in to comment.