@n3/react-confirm

Confirm for react applications based on @n3/kit

Usage no npm install needed!

<script type="module">
  import n3ReactConfirm from 'https://cdn.skypack.dev/@n3/react-confirm';
</script>

README

@n3/react-confirm

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

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

...

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

Параметры

Название Обязательность Тип Значение по умолчанию Описание
modalSize enum
- modalSizes.SMALL
- modalSizes.DEFAULT
modalSizes.SMALL Размер модального окна
title string null Заголовок
content node null Текст
approve func null Асинхронная функция подтверждения, может закончиться с исключением ConfirmError({ title, message })
cancelButtonText + string Текст кнопки отмены
approveButtonText + string Текст кнопки подтвеждения
approveButtonColor enum
- buttonColors.DEFAULT
- buttonColors.PRIMARY
- buttonColors.TERTIARY
- buttonColors.DANGER
buttonColors.PRIMARY Цвет кнопки подтверждения
resolveModal + func