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

108
Visualizações
Transform button into text after condition is true

I'm using the AppBar component of material-ui library, I added a button, I'd say it's hardcoded in the AppBar, I'm trying to transform this button to just a text in the AppBar, but I got nothing.

How can I transform the button in the AppBar to just text?

App.js:

const connectWalletChecker = () => {

    return(
      <div>
        <SearchAppBar id='walletButton' apptitle={apptitle} color='primary' variant='contained' text='Connect Wallet' handle={connectWalletPressed}/>
      </div>
    )
  }

const AlreadyConnected = () => {

    return(
      <div>
        <SearchAppBar id='walletButton' apptitle={apptitle} color='primary' variant='contained' text={walletAddress} handle={null}/>
      </div>
    )
  }

  return(
    <div>
      {walletAddress ? AlreadyConnected() : connectWalletChecker()}
      
    </div>
  )
};

AppBar:

<Button id={props.id} color={props.color} variant={props.variant} 
href="#contained-buttons" onClick={props.handle}>{props.text}</Button>

Full code on Github.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

use variant="text" instead of variant="contained" for transforming button into text.

your code will be :

const connectWalletChecker = () => {

    return(
      <div>
        <SearchAppBar id='walletButton' apptitle={apptitle} color='primary' variant='text' text='Connect Wallet' handle={connectWalletPressed}/>
      </div>
    )
  }

const AlreadyConnected = () => {

    return(
      <div>
        <SearchAppBar id='walletButton' apptitle={apptitle} color='primary' variant='text' text={walletAddress} handle={null}/>
      </div>
    )
  }

  return(
    <div>
      {walletAddress ? AlreadyConnected() : connectWalletChecker()}
      
    </div>
  )
};
about 4 years ago · Juan Pablo Isaza Relatório
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