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

fixed name overflow on sprites #122

Merged
merged 3 commits into from
Feb 18, 2024
Merged

Conversation

azure-kyuri
Copy link
Collaborator

added name overflow on long sprite names (#94 )

@linear
Copy link

linear bot commented Sep 24, 2023

BXC-94 Delete sprite

Button on active sprite button that allows the user to delete a sprite from their project

Copy link
Collaborator

@ElliotRoe ElliotRoe left a 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

Comment on lines 16 to 28
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])

Copy link
Collaborator

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 ?
Copy link
Collaborator

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

Comment on lines 40 to 42
useEffect(() => {
console.log("user is typing")
}, [name])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove debug statements

@azure-kyuri
Copy link
Collaborator Author

I refactored the ternary operator and also removed the debug statement in spriteName.tsx.

@ElliotRoe ElliotRoe merged commit 38a1982 into main Feb 18, 2024
@ElliotRoe ElliotRoe deleted the jaredlim/bxc-94-sprite-name-overflow branch February 18, 2024 14:43
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.

3 participants