-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(layer-tabs): add collapsible layer-selector, highlight selected … #123
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one thing, I just remembered that you can use the classnames lib without the object
<ul className={styles.layerList}> | ||
{layers.map(layer => { | ||
const layerClickHandler = () => { | ||
if (layer.subLayers.length === 0) { | ||
onSelect(layer.id); | ||
} | ||
}; | ||
|
||
const layerItemClass = cx(styles.layerItem, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest this as it is a bit easier to read:
const isSelected = selected === layer.id;
const layerItemClasses = cx(styles.layerItem, isSelected && styles.layerItemSelected);
Also note the plural of the variable name layerItemClasses
;
@@ -31,9 +34,12 @@ const LayerList: FunctionComponent<Props> = ({layers, onSelect}) => ( | |||
event.stopPropagation(); | |||
onSelect(subLayer.id); | |||
}; | |||
const subLayerItemClass = cx(styles.subLayerItem, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
src/scripts/components/tab/tab.tsx
Outdated
@@ -14,7 +14,7 @@ const Tab: FunctionComponent<Props> = ({ | |||
onSelectTabId, | |||
children | |||
}) => { | |||
const btnClass = classNames(styles.btn, { | |||
const btnClass = cx(styles.btn, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also same as above
…layers
closes #12