Skip to content

Commit

Permalink
Merge pull request #112 from KrlosPK/conanDev
Browse files Browse the repository at this point in the history
v1.3.0
  • Loading branch information
KrlosPK authored Mar 27, 2023
2 parents 20c98c9 + 8094e9b commit 391cc29
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "webfam",
"private": true,
"version": "1.2.1",
"version": "1.3.0",
"type": "module",
"scripts": {
"dev": "vite --open",
Expand Down
1 change: 1 addition & 0 deletions src/components/AboutUs/AboutUs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const AboutUs = () => {
<Card src={foto_servicio} title={nombre_servicio} description={resumen_servicio} isButton buttonText={'Detalles'} />
</Link>
))}
<Card src={'https://firebasestorage.googleapis.com/v0/b/fademetuserimg.appspot.com/o/pregunta.jpg?alt=media&token=5ae2cb81-22e8-4e53-9b93-4810bf385883'} title={'¿No encuentras lo que buscas?'} description='Puedes pedir tu servicio metalmecánico personalizado' isModal innerClassName={'card__servicio-personalizado'} />

{(memoizedInactiveService && servicesState === 'inactive') && memoizedInactiveService.map(({ id_servicio, foto_servicio, nombre_servicio, resumen_servicio }) => (
<Link to={`/services/${id_servicio}`} key={id_servicio}>
Expand Down
21 changes: 21 additions & 0 deletions src/components/Services/Services.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,27 @@ const Services = () => {
})
setToastify(false)
}
if (toastify === 'citaAgendada') {
toast.success('¡Cita agendada con éxito!', {
theme: 'colored'
})
setToastify(false)
}
if (toastify === 'citaAgendadaError') {
toast.error('¡Hubo un error al crear la cita!', {
theme: 'colored'
})
setToastify(false)
}
if (toastify === 'citaAgendadaRepetida') {
toast.warning(
'¡Ya tienes una cita pendiente! Por favor, elimínala si ya no la necesitas o espera a que te demos una respuesta.',
{
theme: 'colored'
}
)
setToastify(false)
}
}, [toastify])

useEffect(() => {
Expand Down
7 changes: 7 additions & 0 deletions src/components/Utils/Card/Card.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ picture {
.card__button {
margin: 0.5rem auto;
}
.modal__card-button {
margin-block: 0.5rem;
margin-inline: auto;
}
.card__servicio-personalizado {
cursor: default;
}

@media (max-width: 630px) {
picture {
Expand Down
14 changes: 12 additions & 2 deletions src/components/Utils/Card/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import AOS from 'aos'
import { LazyLoadImage } from 'react-lazy-load-image-component'
import 'react-lazy-load-image-component/src/effects/blur.css'
import { Button2 } from '../Button2/Button2'
import { ModalService } from '../ModalService/ModalService'

const Card = ({
title,
Expand All @@ -16,13 +17,16 @@ const Card = ({
descriptionFont,
src,
isButton = false,
isModal = false,
buttonText,
innerOnClick,
innerClassName,
alt = 'Servicio que ofrece Fademet Montajes'
}) => {
AOS.init({ duration: 700 })

return (
<div className='card' data-aos='fade-right'>
<div className={`card ${innerClassName}`} data-aos='fade-right'>
<picture>
<LazyLoadImage
className='card__image'
Expand All @@ -41,7 +45,13 @@ const Card = ({
{description}
</p>
{isButton && (
<Button2 width={150} text={buttonText} innerClassName='card__button' />
<Button2 width={150} text={buttonText} innerClassName='card__button' innerOnClick={innerOnClick} />
)}
{isModal && (
<ModalService innerClassNameButton={'modal__card-button'} innerCenterButton
nombre_servicio={'Servicio personalizado'}
id_servicio={0}
/>
)}
</div>
)
Expand Down
4 changes: 4 additions & 0 deletions src/components/Utils/ModalService/ModalService.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.section__button-grid-center {
display: grid;
place-items: center;
}
14 changes: 12 additions & 2 deletions src/components/Utils/ModalService/ModalService.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Box } from '@mui/system'

// ? Styles
import { style } from './ModalStyle'
import './ModalService.css'

// ? Libraries
import axios from 'axios'
Expand All @@ -23,7 +24,7 @@ import emailjs from '@emailjs/browser'
import { SessionContext } from '../../../context/SessionContext'
import { ToastifyContext } from '../../../context/ToastifyContext'

const ModalService = ({ nombre_servicio = '', id_servicio = '' }) => {
const ModalService = ({ nombre_servicio = '', id_servicio = '', innerClassNameButton, innerCenterButton }) => {
const nombreInputEl = useRef()
const correoInputEl = useRef()
const numCelularInputEl = useRef()
Expand Down Expand Up @@ -177,7 +178,16 @@ const ModalService = ({ nombre_servicio = '', id_servicio = '' }) => {

return (
<div>
<Button2 innerOnClick={handleModalClick} text='Solicitar' width={220} />
{innerCenterButton
? (
<section className='section__button-grid-center'>
<Button2 innerOnClick={handleModalClick} text='Solicitar' width={220} innerClassName={innerClassNameButton} />
</section>
)
: (
<Button2 innerOnClick={handleModalClick} text='Solicitar' width={220} />
)
}
<Modal
open={openModal}
onClose={handleModalClick}
Expand Down

0 comments on commit 391cc29

Please sign in to comment.