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

186
Visualizações
How to show a Modal once onShowMoreClick is clicked?
<OneProfileKeyCard
    title="Qualification"
    showMoreText="See all qualifications"
    onShowMoreClick={() => console.log('show more')}
>
    Creating, communicating, and implementing the organization&apos;s vision, mission, and overall direction Leading the development and implementation of the overall organization&apos;s strategy.
</OneProfileKeyCard>
import React from 'react'
import './OneProfileKeyCard.scss'

type Props = {
    title: string
    showMoreText: string
    onShowMoreClick: () => void
}

export const OneProfileKeyCard: React.FC<Props> = ({
    title,
    showMoreText,
    onShowMoreClick,
    children
}) => (
    <div className="one-profile-key-card">
        <h3>{ title }</h3>
        <div>
            { children }
        </div>
        <button type="button" onClick={onShowMoreClick}>
            { showMoreText }
        </button>
    </div>
)

could anyone help me to set up a modal? Im trying to set up a modal once onShowMoreClick is clicked that would turn the children(creating, communicating, and implementing the organization...) into a modal. So far it looks like this: enter image description here

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

0

You will need to have a state-managed in the parent component of where the OneProfileKeyCard child component is called from.

Something like this

const Parent = () => {
    const [modalOpen, setModalOpen] = React.useState(false)

return (
   <div>
       <h1>Demo</h1>
        <OneProfileKeyCard
            title="Qualification"
            showMoreText="See all qualifications"
            onShowMoreClick={() => setModalOpen(!modalOpen)}>
                text ... text
        </OneProfileKeyCard>
   </div>
   )
}

I'm not sure what else is within your components, but you'll then need a way to close the model, right now I have set the showMoreClick prop to open/close, but if that should open then set it to true and do a similar pass-through for a closing false function.

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