With knobs following code is perfectly readable and doesn't require any additional ts typings even though it contains a special knob that allows to switch different cases.
const index = () => {
const noDataMessage = text('someMessage', 'There is no data here.');
const icon = select('Icon', ['IconAccountIcon', 'IconInboxIcon'], 'IconInboxIcon');
const IconInboxIcon = <IconInbox marginBottom={10} width={48} height={48} />;
const IconAccountIcon = <IconAccount marginBottom={10} width={48} height={48} />;
const icons = { IconAccountIcon, IconInboxIcon };
return (
<Block height={300} width={700} margin={20}>
<DataStatusMessage text={noDataMessage} icon={icons[icon]} />
</Block>
);
};
This is simple and yet powerful concept.
With Args instead I don't have proper typing, the code is spread across the file and plainly speaking it is inferior
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4