-
Notifications
You must be signed in to change notification settings - Fork 370
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
fix: texto TabCoin no singular concatena com valor booleano #1590
Conversation
@smrsassa is attempting to deploy a commit to the TabNews Team on Vercel. A member of the Team first needs to authorize it. |
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.
Bem observado, @smrsassa! Obrigado pelo PR.
Aproveitando que sugeri uma edição, depois você pode realizar um squash dos commits, deixando a mensagem de commit em inglês, por favor?
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.
Boa @smrsassa, obrigado pelo PR! 💪
@@ -9,7 +9,7 @@ export default function TabCoinCount({ amount, direction, mode = 'tooltip', sx } | |||
}, | |||
full: { | |||
iconSize: 20, | |||
text: `${amount?.toLocaleString('pt-BR')} TabCoin${amount !== 1 && 's'}`, | |||
text: `${amount?.toLocaleString('pt-BR')} TabCoin${Math.abs(amount) === 1 ? '' : 's'}`, |
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.
Considerem o que foi feito no #1461 como referência, então -1, 0 e 1 ficam no singular. Ficaria algo como:
text: `${amount?.toLocaleString('pt-BR')} TabCoin${Math.abs(amount) === 1 ? '' : 's'}`, | |
text: `${amount?.toLocaleString('pt-BR')} TabCoin${amount > 1 || amount < -1 ? 's' : ''}`, |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
@smrsassa, não passou no Lint do commit.
Use o comando npm run commit
para criar a mensagem no padrão do projeto, ou use algo já no padrão, como:
fix(tabcoin_count): fix the singular TabCoin text
@smrsassa, seu código já está rodando em produção! 🚀🚀🚀 Bem vindo à Turma de Contribuidores do TabNews! 👏👏👏 |
Mudanças realizadas
No componente TabCoinCount, existe uma condição para retirar ou adicionar o plural, dependendo se o usuário possui uma única ou mais TabCoins.
O problema ocorre quando o usuário possui apenas uma TabCoin. Nessa condição, a verificação
amount !== 1
faz com que o seu retorno booleano seja concatenado na string "TabCoin", como por exemplo:Mudei essa condição utilizando o operador ternário para corrigir o problema.
Tipo de mudança