Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { mount, compileNow } from '@storybook/riot';
import { action } from '@storybook/addon-actions';
import ButtonRaw from './Button.txt';
compileNow(ButtonRaw);
export default {
title: 'Addon/Actions',
};
export const actionOnly = () =>
mount('my-button', {
handleClick: action('button-click'),
content: 'Click me to log the action',
});
actionOnly.story = {
name: 'Action only',
};
export const multipleActions = () =>
import { mount, compileNow } from '@storybook/riot';
import { linkTo } from '@storybook/addon-links';
import ButtonRaw from './Button.txt';
compileNow(ButtonRaw);
export default {
title: 'Addon/Links',
};
export const goToWelcome = () =>
mount('my-button', {
rounded: true,
content: 'This button links to Welcome',
value: 'with a parameter',
handleClick: linkTo('Welcome', 'Welcome'),
});
goToWelcome.story = {
name: 'Go to welcome',
};