From 5d17e4e165fb5f00a355fa9b239e928ce0f7d022 Mon Sep 17 00:00:00 2001 From: ialexanderbrito Date: Tue, 10 Jan 2023 00:32:19 -0300 Subject: [PATCH] feat: add choice services --- src/pages/Schedule/Schedule.module.scss | 87 +++++++++++++++++++++++++ src/pages/Schedule/index.tsx | 59 ++++++++++++++++- 2 files changed, 145 insertions(+), 1 deletion(-) diff --git a/src/pages/Schedule/Schedule.module.scss b/src/pages/Schedule/Schedule.module.scss index 8053acb..53f32f5 100644 --- a/src/pages/Schedule/Schedule.module.scss +++ b/src/pages/Schedule/Schedule.module.scss @@ -85,6 +85,93 @@ margin-top: 24px; } +.wrapperService { + display: flex; + flex-direction: column; + gap: 1.5rem; +} + +.containerService { + display: grid; + grid-template-columns: repeat(3, minmax(0px, 1fr)); + gap: 1rem; + margin-top: 12px; +} + +.service { + display: flex; + flex-direction: column; + align-items: center; + position: relative; + aspect-ratio: 1 / 1; + cursor: pointer; + width: 100%; + gap: 1rem; + border-radius: 0.5rem; + padding: 0.25rem; + border-width: 5px; +} + +.serviceSelected { + display: flex; + flex-direction: column; + align-items: center; + position: relative; + aspect-ratio: 1 / 1; + cursor: pointer; + width: 100%; + gap: 1rem; + border-radius: 0.5rem; + padding: 0.25rem; + border-width: 5px; + border: 1px solid var(--orange); +} + +.containerInfo { + display: flex; + position: absolute; + width: 80%; + align-items: center; + justify-content: flex-end; +} + +.imageService { + object-fit: cover; + width: 100%; + height: 100%; + border-radius: 0.5rem; + top: 0px; + left: 0px; + position: absolute; + max-width: 100%; + background: var(--gray-hard); +} + +.containerServiceInfo { + display: flex; + position: absolute; + bottom: 0px; + width: 100%; + flex-direction: column; + align-items: center; + gap: 0.25rem; + border-bottom-right-radius: 0.5rem; + border-bottom-left-radius: 0.5rem; + background-color: rgba(0, 0, 0, 0.698); + padding: 0.313rem 0.625rem; +} + +.textService { + overflow: hidden; + line-break: anywhere; + display: -webkit-box; + -webkit-line-clamp: 1; + line-height: 0.75rem; + font-size: 0.75rem; + text-overflow: ellipsis; + white-space: nowrap; +} + @media screen and (min-width: 839px) { .home { background: var(--background); diff --git a/src/pages/Schedule/index.tsx b/src/pages/Schedule/index.tsx index d78da12..bec208f 100644 --- a/src/pages/Schedule/index.tsx +++ b/src/pages/Schedule/index.tsx @@ -1,7 +1,9 @@ import { DayPicker } from 'react-day-picker'; -import { FiCheck } from 'react-icons/fi'; +import { FiCheck, FiInfo } from 'react-icons/fi'; import { SiWhatsapp } from 'react-icons/si'; +import { Skeleton, Tooltip } from '@mui/material'; +import { imgRasgLight } from 'assets'; import ptBR from 'date-fns/locale/pt-BR'; import { Button } from 'components/Button'; @@ -31,6 +33,8 @@ export function Schedule() { postShedule, verificaDataEHoraSelecionada, status, + selectedService, + setSelectedService, } = useUser(); const { @@ -40,6 +44,9 @@ export function Schedule() { getHorariosTardeBarbeiro, getHorariosNoiteBarbeiro, disableSchedules, + servicesBarber, + savePhotoServices, + loading, } = useSchedule(); const { contactBarbeiro } = useOverlay(); @@ -103,6 +110,56 @@ export function Schedule() {
<> +

Escolha o serviço

+ +
+
+ {loading ? ( + Array.from(new Array(3)).map((_, index) => ( + + )) + ) : ( + <> + {servicesBarber.map((service, index) => ( +
{ + setSelectedService(service); + }} + > + {service.deServico} + +
+ +
+
+
+ + {service.nmServico} + +
+
+ ))} + + )} +
+
+

Escolha o horário

{getHorariosManhaBarbeiro().length > 0 &&

Manhã

}