Skip to content
Permalink
Browse files

Display unnamed custom hooks as 'Anonymous'

  • Loading branch information...
bvaughn committed Jun 18, 2019
1 parent a2c79f2 commit abc8ef3d5da8652e4741212d4da0d3fc72d70451
Showing with 19 additions and 6 deletions.
  1. +9 −2 src/devtools/views/Components/HooksTree.css
  2. +10 −4 src/devtools/views/Components/HooksTree.js
@@ -24,11 +24,18 @@
display: flex;
}

.Name {
color: var(--color-dim);
.Name,
.NameAnonymous {
flex: 0 0 auto;
user-select: none;
}
.Name {
color: var(--color-dim);
}
.NameAnonymous {
color: var(--color-dimmer);
}

.EditableName {
color: var(--color-attribute-name);
flex: 0 0 auto;
@@ -176,8 +176,11 @@ function HookView({
<div className={styles.Hook}>
<div className={styles.NameValueRow}>
<ExpandCollapseToggle isOpen={isOpen} setIsOpen={setIsOpen} />
<span onClick={toggleIsOpen} className={styles.Name}>
{name}
<span
onClick={toggleIsOpen}
className={name !== '' ? styles.Name : styles.NameAnonymous}
>
{name || 'Anonymous'}
</span>
</div>
<div className={styles.Children} hidden={!isOpen}>
@@ -197,8 +200,11 @@ function HookView({
<div className={styles.Hook}>
<div className={styles.NameValueRow}>
<ExpandCollapseToggle isOpen={isOpen} setIsOpen={setIsOpen} />
<span onClick={toggleIsOpen} className={styles.Name}>
{name}
<span
onClick={toggleIsOpen}
className={name !== '' ? styles.Name : styles.NameAnonymous}
>
{name || 'Anonymous'}
</span>{' '}
{/* $FlowFixMe */}
<span className={styles.Value}>{displayValue}</span>

0 comments on commit abc8ef3

Please sign in to comment.
You can’t perform that action at this time.