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

131
Visualizações
How would I make a MUI button take up the entirety of a Grid?

I have a Grid which needs to be a square that is responsive to window size, and inside this grid is a button which should take up the entirety of the grid. Currently, the grid resizes properly, but the contents inside of it do not take up the full size of the Grid. Here is my code

galleryButtonContainer: {
    width: '100%',
    height: 0,
    paddingBottom: '100%',
    borderRadius: '20%',
    backgroundColor: theme.palette.grey.light,
    '&:hover': {
      backgroundColor: theme.palette.grey.light,
    },
  },
  image: {
    objectFit: 'cover',
    width: '100%',
    height: '100%',
    borderRadius: '20%',
  },
  thumbnailIcon: {
    width: '50%',
    height: '50%',
  },
<Grid className={classes.galleryButtonContainer}>
  <Button
    onClick={() =>
      toPage(
        `/gallery/view/organizationEvent/${data.organizationEventId}`
      )
    }
  >
    {hasPhotos ? (
      <img
        src={thumbnail}
        alt="gallery thumbnail"
        className={classes.image}
      />
    ) : (
      <PhotoLibraryIcon className={classes.thumbnailIcon} />
    )}
  </Button>
</Grid>

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