Skip to content

Instantly share code, notes, and snippets.

@MykolaGolubyev
Created February 20, 2019 23:26
Show Gist options
  • Save MykolaGolubyev/cbc40861c31716fe37521d501eb78eaa to your computer and use it in GitHub Desktop.
Save MykolaGolubyev/cbc40861c31716fe37521d501eb78eaa to your computer and use it in GitHub Desktop.
export class MyAppComponentViewer extends React.Component {
render() {
return (
<ComponentViewer
registries={registries}
dropDown={{
label: 'Brand',
items: [
{label: 'Brand One', hotKey: 'Alt 1'},
{label: 'Brand Two', hotKey: 'Alt 2'}
],
onSelect: this.onBrandSelect
}}
/>
);
}
private onBrandSelect = (brand: string) => {
const brandDir = brand.toLocaleLowerCase();
updateCssRef('stylesheet', brandDir, 'style');
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment