Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

230
Vistas
How to display the avatar of all the user but it should have a limit of 6 or 4 then there will be a display all button to display the rest?

I'm creating a component in react that will display the avatar of the user but the catch is there will be limit on how many avatar will show. The solution that I'm thinking is using .slice(0,4).map then I'm gonna make a condition statement that if the length of the list is greater than 4 the button show all will appear. If the user click the button that rest of the user will pop up. The problem is how can display the rest of the user inside the pop up container?

<div className='pl-12 pr-6'>
        <div className='flex items-center justify-right'>
          {filterInfo &&
            filterInfo
              .slice(1, 10)
              .map((data) => (
                <img
                  className={`mr-2 rounded-full border-1px ${
                    active === data.creator[0]._id
                      ? 'border-primary p-0.5 opacity-100'
                      : ''
                  } cursor-pointer transition duration-75 ease-in opacity-70`}
                  key={data._id}
                  id={data.creator[0]._id}
                  src={data.creator[0].accountProfileUploaded}
                  alt={`${data.creator[0].firstName} ${data.creator[0].lastName}`}
                  title={`${data.creator[0].firstName} ${data.creator[0].lastName}`}
                  style={{ width: '40px', height: '40px' }}
                  onClick={handleOnFilterByProfile}
                />
              ))}

          {filterInfo && filterInfo.length >= 2 ? (
            <div
              className='shadow-md rounded-full relative'
              style={{ width: '40px', height: '40px' }}
            >
              <ChevronDoubleDownIcon
                className='h-4 w-4 absolute mt-3.5 ml-3 opacity-60 cursor-pointer hover:text-primary'
                aria-hidden='true'
              />
            </div>
          ) : null}
        </div>
      </div>

Thanks!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda