Skip to content

Instantly share code, notes, and snippets.

@zindel
Created February 16, 2016 12:33
Show Gist options
  • Save zindel/af4aa58c1aa0502b9411 to your computer and use it in GitHub Desktop.
Save zindel/af4aa58c1aa0502b9411 to your computer and use it in GitHub Desktop.
function LaunchButton({url, text, attachLeft = false, attachRight = false}) {
return (!url ? null :
<ui.Button
size="small"
attach={{left: attachLeft, right: attachRight}}>
<Link href={url} target="_blank">
{text}
</Link>
</ui.Button>
);
}
function SourceLauncher({inspectUrl, wizardSource, actionSource}) {
return (
<div style={{
position: 'absolute',
top: 5,
right: 5,
zIndex: 9999,
}}>
<LaunchButton
url={inspectUrl}
attachRight={wizardSource || actionSource}
text="Inspect"
/>
<LaunchButton
url={wizardSource}
attachLeft={inspectUrl}
attachRight={actionSource}
text="Wizard Source"
/>
<LaunchButton
url={actionSource}
attachLeft={inspectUrl || wizardSource}
text="Action Source"
/>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment