Custom Views
Customising UI Views
viewOverrides?: {
view: string: {
component: ViewComponent
options?: { [key: string]: any }
}
} import {AbstractView} from "./view-interface";
class MyCustomView extends AbstractView {
constructor(client: Client, popup: Ui, viewContainer: HTMLElement, params: any, private someOtherObjectINeed: any) {
super(client, popup, viewContainer, params);
}
init() {
// view initialised
}
update() {
// optional method
}
render(){
this.viewContainer.innerHTML = "<div>hello world</div>"
}
}
const negotiator = new Client({
type: "active",
issuers: [
{
blockchain: "evm",
onChain: true,
collectionID: "expansion-punks",
contract: "0x0d0167a823c6619d430b1a96ad85b888bcf97c37",
chain: "eth",
}
],
uiOptions: {
uiType: "inline",
openingHeading: "Connect your NFT to access custom content and more.",
issuerHeading: "Your Off Chain Attestations",
repeatAction: "try again",
theme: "light",
position: "bottom-right",
alwaysShowStartScreen: false,
viewOverrides: {
"start": {
component: MyCustomView,
options: {
myCustomOption: "My custom text",
viewTransition: "slide-in-bottom"
}
}
}
},
});
Last updated