Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
Implementación de insignias con react y material-ui

Estoy tratando de mostrar un ícono de insignia cuando un componente tiene notas adjuntas. Lo he intentado de tres maneras y obtengo los mismos resultados que me parecen extraños. ¿Cuál es la mejor manera de implementar esto? O hay otra manera

primero importe Badge desde '@material-ui/core/Badge';

 function NotesBadge({ hasNotes }) { return ( <Badge anchorOrigin={{ vertical: 'top', horizontal: 'right',}} variant="dot" color="primary" invisible={hasNotes}> </Badge> ); } export default NotesBadge;

segundo

 import Badge from '@material-ui/core/Badge'; function NotesBadge({ hasNotes }) { return ( <Badge anchorOrigin={{ vertical: 'top', horizontal: 'right',}} variant="dot" color="primary" invisible={!hasNotes}> </Badge> ); } export default NotesBadge;

tercera

 import Badge from '@material-ui/core/Badge'; function NotesBadge({ hasNotes }) { if(hasNotes){ return ( <Badge anchorOrigin={{ vertical: 'top', horizontal: 'right',}} variant="dot" color="primary" invisible={false}> </Badge> ); } } export default NotesBadge;

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El segundo enfoque es el camino a seguir, ya que Badge debe ser invisible cuando hasNotes es falso, de ahí el nombre.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!