[ENG-1637] Add Hover info text on base icon#962
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
2bec661 to
6c5cdc4
Compare
| ref={(el) => { | ||
| if (el) | ||
| setTooltip(el, `Create Base view for ${nodeType.name} nodes`); | ||
| }} |
There was a problem hiding this comment.
The tooltip uses nodeType.name directly, but line 158 shows that nodeType.name can be falsy (using nodeType.name || "Unnamed Node Type"). When nodeType.name is undefined/null/empty, the tooltip will display inconsistent text like "Create Base view for undefined nodes" while the UI shows "Unnamed Node Type".
Fix:
ref={(el) => {
if (el) {
const name = nodeType.name || "Unnamed Node Type";
setTooltip(el, `Create Base view for ${name} nodes`);
}
}}| ref={(el) => { | |
| if (el) | |
| setTooltip(el, `Create Base view for ${nodeType.name} nodes`); | |
| }} | |
| ref={(el) => { | |
| if (el) | |
| const name = nodeType.name || "Unnamed Node Type"; | |
| setTooltip(el, `Create Base view for ${name} nodes`); | |
| }} | |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
mdroidian
left a comment
There was a problem hiding this comment.
Probably should deal with the graphite suggestion, or maybe handle null nodeType.name higher up the chain.
Before:

After:
