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

121
Visualizações
What's causing each word to stack instead of being in a straight line?

I have the following piece of code in my component

          if (buyer !== null) {
            return (
              <Card>
                <li key={sale_id}>
                  <h3>
                    <Transaction>{seller}</Transaction> just sold item number{' '}
                    <Transaction>{sale_id}</Transaction> to{' '}
                    <Transaction>{buyer}</Transaction> for{' '}
                    <Transaction>{formatNumber(listing_price)}</Transaction>{' '}
                    {listing_symbol} at {parseTimestampJM(created_at_time)}
                  </h3>
                </li>
              </Card>
            );
          }

the Transaction and Card components are made of the following code :

export const Card = styled.article`
  width: 100%;
  height: 144px;
  border-radius: 16px;
  border: solid 1px #e6e6e6;
  display: flex;
  align-items: center;

  @media (max-width: 1300px) {
    justify-content: center;
  }

  ${breakpoint.mobile`
    justify-content: flex-start;
  `}
`;

export const Transaction = styled.h2`
  font-size: 15px;
  fontweight: 'bold';
  color: purple;
  margin-bottom: 8px;

  ${breakpoint.tablet`
    font-size: 20px;
    line-height: 32px;
    margin-bottom: 4px;
  `}

  ${breakpoint.mobile`
    font-size: 28px;
    line-height: 40px;
    margin-bottom: 8px;
  `}
`;

This is resulting in a card that flexes with the webpage width but I can't get the text to fit in right. The text is stacking on top of each other. Seller is on just sold.. which is on Sale-id ... etc. I would like just one line of text where it becomes two if the card is to small to fit the text in it.

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