/
sdds
/
plasma
Обзор
Документация
Войти
/
sdds
/
plasma
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
dev
packages/sdds-dfa/src/components/Notification/Notification.tsx
36 строк
1 KB
TitanKuzmich
feat(*): add type cast for Notification
10 июн 2025, 11:08
10 июн 2025, 11:08
7c69c50
Код
Авторство
О чём код?
import React, { ComponentProps, ForwardRefExoticComponent, ReactNode } from 'react'; import { NotificationProps as NotificationPropsNewHope, NotificationPlacement, notificationConfig, NotificationsProvider as Provider, component, mergeConfig, } from '@salutejs/plasma-new-hope/styled-components'; import { config } from './Notification.config'; export type { NotificationPlacement }; const mergedConfig = mergeConfig(notificationConfig, config); export const NotificationNewHope = component(mergedConfig); type ConfigProps = 'size' | 'view' | 'layout' | 'closeIconType'; type NotificationProps = Pick<ComponentProps<typeof NotificationNewHope>, ConfigProps> & Omit<NotificationPropsNewHope, ConfigProps>; export const Notification = NotificationNewHope as ForwardRefExoticComponent<NotificationProps>; export const NotificationsProvider: React.FC<{ children: ReactNode; frame?: string; placement?: NotificationPlacement; UNSAFE_SSR_ENABLED?: boolean; }> = ({ children, frame = 'document', placement, UNSAFE_SSR_ENABLED }) => { return ( <Provider config={mergedConfig} frame={frame} placement={placement} UNSAFE_SSR_ENABLED={UNSAFE_SSR_ENABLED}> {children} </Provider> ); };