-
Notifications
You must be signed in to change notification settings - Fork 0
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
fixed name overflow on sprites #122
Conversation
BXC-94 Delete sprite
Button on active sprite button that allows the user to delete a sprite from their project |
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.
Looks good, just need to refactor the ternary and remove some code used for debugging
let inputName = '' | ||
|
||
// Upon a name change, re-render the sprite's card in a local variable. | ||
// useEffect(() => { | ||
// if ((target?.sprite?.name).length > 16) { | ||
// inputName = (target?.sprite?.name).substring(0, 13) + '...' | ||
// } | ||
// else { | ||
// inputName = target?.sprite?.name | ||
// } | ||
|
||
// }, [target?.sprite?.name]) | ||
|
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.
Is this needed?
</ItemCard> | ||
return ( | ||
<> | ||
{target?.sprite?.name.length > 13 ? |
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.
Would probably refactor this ternary into an if statement in the body of the component's function. Just so we don't have to repeat a bunch of JSX
useEffect(() => { | ||
console.log("user is typing") | ||
}, [name]) |
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.
Remove debug statements
I refactored the ternary operator and also removed the debug statement in spriteName.tsx. |
added name overflow on long sprite names (#94 )