Skip to content

Commit

Permalink
chore: Add padding config (#16)
Browse files Browse the repository at this point in the history
* add padding config

* changeset

* fix typo

---------

Co-authored-by: Nick Cruz <[email protected]>
  • Loading branch information
tian000 and nickcruz authored Nov 19, 2024
1 parent dee7640 commit e6422b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/rude-parrots-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@phantom/wallet-sdk": patch
---

Add paddingBottom and paddingRight configuration options
9 changes: 9 additions & 0 deletions packages/sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export type CreatePhantomConfig = Partial<{
zIndex: number;
hideLauncherBeforeOnboarded: boolean;
colorScheme: string;
paddingBottom: number;
paddingRight: number;
}>;

export function createPhantom(config: CreatePhantomConfig = {}) {
Expand All @@ -20,6 +22,13 @@ export function createPhantom(config: CreatePhantomConfig = {}) {
);
if (config.colorScheme)
sdkURL.searchParams.append("colorScheme", config.colorScheme.toString());
if (config.paddingBottom)
sdkURL.searchParams.append(
"paddingBottom",
config.paddingBottom.toString(),
);
if (config.paddingRight)
sdkURL.searchParams.append("paddingRight", config.paddingRight.toString());

scriptTag.setAttribute("type", "module");
scriptTag.setAttribute("src", sdkURL.toString());
Expand Down

0 comments on commit e6422b1

Please sign in to comment.