Skip to content
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

Merged
merged 4 commits into from
Oct 7, 2019

Conversation

KatvonRivia
Copy link
Member

@KatvonRivia KatvonRivia commented Oct 2, 2019

…layers

closes #12

Copy link
Contributor

@pwambach pwambach left a 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, {
Copy link
Contributor

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, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@@ -14,7 +14,7 @@ const Tab: FunctionComponent<Props> = ({
onSelectTabId,
children
}) => {
const btnClass = classNames(styles.btn, {
const btnClass = cx(styles.btn, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also same as above

@pwambach pwambach merged commit 2ed8363 into develop Oct 7, 2019
@pwambach pwambach deleted the feat/layer-tabs branch October 7, 2019 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Layer selector
2 participants