Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

185
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda