0.2.0 • Published 3 years ago

@n3/react-confirm v0.2.0

Weekly downloads
44
License
MIT
Repository
gitlab
Last release
3 years ago

@n3/react-confirm

Всплывающее подтверждение для приложений на базе @n3/kit.

import {
  showConfirm,
  ConfirmError,
} from '@n3/react-confirm';

...

const result = await showConfirm({
  title: 'Таблица «Отчет 23.10.2019»',
  content: 'Вы сможете переместить таблицу обратно в любое время.',
  approveButtonText: 'Переместить',
  cancelButtonText: 'Оставить',
});

Параметры

НазваниеОбязательностьТипЗначение по умолчаниюОписание
modalSizeenum- modalSizes.SMALL- modalSizes.DEFAULTmodalSizes.SMALLРазмер модального окна
titlestringnullЗаголовок
contentnodenullТекст
approvefuncnullАсинхронная функция подтверждения, может закончиться с исключением ConfirmError({ title, message })
cancelButtonText+stringТекст кнопки отмены
approveButtonText+stringТекст кнопки подтвеждения
approveButtonColorenum- buttonColors.DEFAULT- buttonColors.PRIMARY- buttonColors.TERTIARY- buttonColors.DANGERbuttonColors.PRIMARYЦвет кнопки подтверждения
resolveModal+func