Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19 from prismatic-io/tr/inherit-screenconfigurati…
Browse files Browse the repository at this point in the history
…on-options

screenConfiguration options set at .showMarketplace should inherit from .init options
  • Loading branch information
taylorreece committed Jan 4, 2023
2 parents 083ad7b + c282757 commit 290515a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -37,5 +37,8 @@
"typescript": "4.9.4",
"webpack": "5.75.0",
"webpack-cli": "5.0.1"
},
"dependencies": {
"lodash.merge": "4.6.2"
}
}
9 changes: 8 additions & 1 deletion src/index.ts
@@ -1,3 +1,4 @@
import merge from "lodash.merge";
import init from "./init";
import authenticate from "./authenticate";
import { modalSelector, iframeContainerSelector } from "./selectors";
Expand Down Expand Up @@ -30,7 +31,9 @@ interface MarketplaceConfiguration {
}

interface InitializingConfiguration {
/** The background color of the loading screen */
background: string;
/** The font color of the loading screen text and loading icon */
color: string;
}

Expand Down Expand Up @@ -153,7 +156,11 @@ const setIframe = (
if (options) {
Object.entries(options).forEach(([key, value]) => {
if (key in state) {
state[key] = value;
if (state[key] instanceof Object) {
state[key] = merge(state[key], value);
} else {
state[key] = value;
}
}
});
}
Expand Down

0 comments on commit 290515a

Please sign in to comment.