From a9619f0f0dd01a854e78144a161df6196232f12e Mon Sep 17 00:00:00 2001 From: Evgeny Zakharov Date: Thu, 19 Oct 2023 18:40:03 +0400 Subject: [PATCH] Revert "feat: disable appointment creating" This reverts commit d56c89c9a694c6d7d75344a9896f0a6efef324a1. --- src/pages/appointments/page.tsx | 28 ++++++++---- src/pages/home/page.tsx | 2 + .../ui/feedback/notification/notification.tsx | 45 ++++++++++++------- 3 files changed, 50 insertions(+), 25 deletions(-) diff --git a/src/pages/appointments/page.tsx b/src/pages/appointments/page.tsx index f598312..8c33814 100644 --- a/src/pages/appointments/page.tsx +++ b/src/pages/appointments/page.tsx @@ -6,7 +6,13 @@ import { import { useBackRoute } from '@features/go-back' import { routes } from '@routing/shared' import { Appointment } from '@shared/api/webapp/types' -import { ButtonLink, Container, ResultCard, Skeleton } from '@shared/ui' +import { + ButtonLink, + Container, + ResultCard, + Skeleton, + StickyActions, +} from '@shared/ui' import { BaseTemplate } from '@templates/base' import { Header } from '@widgets/header' import { useUnit } from 'effector-react' @@ -56,16 +62,11 @@ const Content = () => { description={[ После покупки записи здесь можно будет отслеживать текущее место в - очереди и примерное количество дней до получения слота На данный - момент запись в консульство недоступна из-за высокой загруженности + очереди и примерное количество дней до получения слота , ]} actions={ - + Записаться в консульство } @@ -103,5 +104,14 @@ const Content = () => { }, ) - return <>{appointmentsJsx} + return ( + <> + {appointmentsJsx} + + + Добавить запись + + + + ) } diff --git a/src/pages/home/page.tsx b/src/pages/home/page.tsx index f24358b..9ffd2ff 100644 --- a/src/pages/home/page.tsx +++ b/src/pages/home/page.tsx @@ -1,3 +1,4 @@ +import { StickyPurchaseOffer } from '@features/show-sticky-purchase-offer' import { routes } from '@routing/shared' import { Container } from '@shared/ui' import { BaseTemplate } from '@templates/base' @@ -52,6 +53,7 @@ export const HomePage = () => { }} /> + ) } diff --git a/src/shared/ui/feedback/notification/notification.tsx b/src/shared/ui/feedback/notification/notification.tsx index 81dbc97..aed1016 100644 --- a/src/shared/ui/feedback/notification/notification.tsx +++ b/src/shared/ui/feedback/notification/notification.tsx @@ -5,25 +5,42 @@ import toast, { ToastType, ValueFunction, } from 'react-hot-toast' -import { Icon, IconName, Typography } from '../../index' +import { Icon, Typography } from '../../index' import css from './styles.module.css' -interface IconConfig { - name: IconName - color: string -} +function mapTypeToIcon(type: ToastType) { + if (type === 'error') + return ( + + ) + + if (type === 'success') + return ( + + ) -const icons: Record = { - error: { name: 'cross-circle', color: 'text-failure' }, - success: { name: 'checkmark-circle', color: 'text-[#21C02E]' }, - custom: { name: 'cross-circle', color: 'text-blue-900' }, - loading: { name: 'cross-circle', color: 'text-blue-900' }, - blank: { name: 'cross-circle', color: 'text-blue-900' }, + return ( + + ) } export const createNotificationComponent = (type: ToastType, message: string): ValueFunction => ({ id, visible }) => { + const icon = mapTypeToIcon(type) + return (
toast.dismiss(id)} > - + {icon}