lint(curly): consistent use of curly brackets in codebase (#3584)

This commit is contained in:
Alireza authored and GitHub committed 2023-08-09 10:07:33 -04:00
1 parent 9ae3d9f769
commit 5d435424e2
113 files changed
+1501 -1056

No files matched your search

@@ -12,11 +12,17 @@ const ListMenu = ({ items = [], renderer, onClick }) => {
const onClickHandler = () => {
setSelectedIndex(index);
onClick({ item, selectedIndex: index });
if (item.onClick) item.onClick({ ...item, index, isSelected });
if (item.onClick) {
item.onClick({ ...item, index, isSelected });
}
};
return (
<div className={classnames(flex, theme, 'cursor-pointer')} onClick={onClickHandler} data-cy={item.id}>
<div
className={classnames(flex, theme, 'cursor-pointer')}
onClick={onClickHandler}
data-cy={item.id}
>
{renderer && renderer({ ...item, index, isSelected })}
</div>
);
@@ -38,16 +44,16 @@ const ListMenu = ({ items = [], renderer, onClick }) => {
);
};
const noop = () => { };
const noop = () => {};
ListMenu.propTypes = {
items: PropTypes.array.isRequired,
renderer: PropTypes.func.isRequired,
onClick: PropTypes.func
onClick: PropTypes.func,
};
ListMenu.defaultProps = {
onClick: noop
onClick: noop,
};
export default ListMenu;