InboxSDK.load(2, '---omitted---').then(function(sdk){
// the SDK has been loaded, now do something with it! sdk.Toolbars.registerThreadButton(function(toolbarButtonDescriptor) { //(composeView){ title: 'Report', /*
WHEN UNCOMMENTED, CAUSES BUTTON TO DISAPPEAR ENTIRELY
iconUrl: 'https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwjKlf66h_TbAhUEiVQKHVs5AOAQjRx6BAgBEAU&url=https%3A%2F%2Fwww.iconspng.com%2Fimage%2F64049%2Fremix-of-star-by-artokem&psig=AOvVaw1oy2SMPlXOpYJqEkyNg25O&ust=1530196266817718', listSection: sdk.Toolbars.SectionNames.INBOX_STATE, hasDropdown: true, onClick: function(event) {
},*/
toolbarButtonDescriptor.addToolbarButtonForApp({ title: "Report", onClick: function(event) {
event.DropdownView.setPlacementOptions({ poisition: "top", hAlign: "center",
});
}
});
});});InboxSDK.load(2, 'toolbar-example').then(sdk => { sdk.Toolbars.registerThreadButton({ iconUrl: chrome.runtime.getURL('foo.png'), title: 'Foo Button', listSection: sdk.Toolbars.SectionNames.INBOX_STATE, hasDropdown: true, onClick(event) { event.dropdown.el.innerHTML = '<div><button type="button">foo</button></div><div>text</div>'; console.log('thread button click event', event); } });});selectedThreadViews (ThreadView[])" property of the "onClick" function to display a user message, but I'm unsure how exactly I would use, for example, the "addNoticeBar()" method. Would you be able to provide an example of adding a notice bar when the user clicks the toolbar button?const noticeBar = threadView.addNoticeBar();
noticeBar.el.textContent = 'foo';const noticeBar = threadView.addNoticeBar();ReactDOM.render(<MyComponent onRemove={() => noticeBar.destroy()} />, noticeBar.el);noticeBar.on('destroy', () => ReactDOM.unmountComponentAtNode(noticeBar.el));InboxSDK.load(2, '-------').then(function(sdk){
// Make a button on the top toolbar sdk.Toolbars.registerThreadButton( { title: 'Report', iconUrl: chrome.runtime.getURL('https://cdn.shopify.com/s/files/1/0885/7466/products/smiley-decal_32x32.png'), listSection: sdk.Toolbars.SectionNames.INBOX_STATE, hasDropdown: false, positions: ['THREAD'],
onClick(event) { // Notice bar at the top of the thread view const noticeBar = threadView.addNoticeBar(); noticeBar.el.textContent = 'Hello.'; noticeBar.destroyed = false; } });
});--
You received this message because you are subscribed to the Google Groups "InboxSDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inboxsdk+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/inboxsdk/73a745e9-b1f9-44f9-b3d3-dce8ce563ea4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
"web_accessible_resources": [ "*.png" ],