Skip to content

Commit

Permalink
Revert "feat: disable appointment creating"
Browse files Browse the repository at this point in the history
This reverts commit d56c89c.
Evgeny Zakharov committed Oct 19, 2023
1 parent d56c89c commit a9619f0
Showing 3 changed files with 50 additions and 25 deletions.
28 changes: 19 additions & 9 deletions src/pages/appointments/page.tsx
Original file line number Diff line number Diff line change
@@ -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={[
<Fragment key={1}>
После покупки записи здесь можно будет отслеживать текущее место в
очереди и примерное количество дней до получения слота На данный
момент запись в консульство недоступна из-за высокой загруженности
очереди и примерное количество дней до получения слота
</Fragment>,
]}
actions={
<ButtonLink
to={routes.appointmentCreate}
fluid={true}
disabled={true}
>
<ButtonLink to={routes.appointmentCreate} fluid={true}>
Записаться в консульство
</ButtonLink>
}
@@ -103,5 +104,14 @@ const Content = () => {
},
)

return <>{appointmentsJsx}</>
return (
<>
{appointmentsJsx}
<StickyActions>
<ButtonLink to={routes.appointmentCreate} fluid={true}>
Добавить запись
</ButtonLink>
</StickyActions>
</>
)
}
2 changes: 2 additions & 0 deletions src/pages/home/page.tsx
Original file line number Diff line number Diff line change
@@ -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 = () => {
}}
/>
</Container>
<StickyPurchaseOffer />
</BaseTemplate>
)
}
45 changes: 29 additions & 16 deletions src/shared/ui/feedback/notification/notification.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<Icon
name="cross-circle"
className={clsx(css.icon, 'text-failure')}
size={32}
/>
)

if (type === 'success')
return (
<Icon
name="checkmark-circle"
className={clsx(css.icon, 'text-[#21C02E]')}
size={32}
/>
)

const icons: Record<ToastType, IconConfig> = {
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 (
<Icon
name="time-circle"
className={clsx(css.icon, 'text-blue-900')}
size={32}
/>
)
}

export const createNotificationComponent =
(type: ToastType, message: string): ValueFunction<Renderable, Toast> =>
({ id, visible }) => {
const icon = mapTypeToIcon(type)

return (
<div
className={clsx(css.notification)}
@@ -32,11 +49,7 @@ export const createNotificationComponent =
data-visible={visible}
onClick={() => toast.dismiss(id)}
>
<Icon
className={clsx(css.icon, icons[type].color)}
name={icons[type].name}
size={32}
/>
{icon}
<Typography.Paragraph
color="primary"
dangerouslySetInnerHTML={{ __html: message }}

0 comments on commit a9619f0

Please sign in to comment.