Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

231
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda