mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-26 03:18:17 +01:00
Sticker Creator
This commit is contained in:
committed by
Scott Nonnenberg
parent
2df1ba6e61
commit
11d47a8eb9
39
sticker-creator/elements/ConfirmDialog.tsx
Normal file
39
sticker-creator/elements/ConfirmDialog.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import * as React from 'react';
|
||||
import * as styles from './ConfirmDialog.scss';
|
||||
import { useI18n } from '../util/i18n';
|
||||
|
||||
export type Props = {
|
||||
readonly title: string;
|
||||
readonly children: React.ReactNode;
|
||||
readonly confirm: string;
|
||||
readonly onConfirm: () => unknown;
|
||||
readonly cancel?: string;
|
||||
readonly onCancel: () => unknown;
|
||||
};
|
||||
|
||||
export const ConfirmDialog = ({
|
||||
title,
|
||||
children,
|
||||
confirm,
|
||||
cancel,
|
||||
onConfirm,
|
||||
onCancel,
|
||||
}: Props) => {
|
||||
const i18n = useI18n();
|
||||
const cancelText = cancel || i18n('StickerCreator--ConfirmDialog--cancel');
|
||||
|
||||
return (
|
||||
<div className={styles.base}>
|
||||
<h1 className={styles.title}>{title}</h1>
|
||||
<p className={styles.text}>{children}</p>
|
||||
<div className={styles.bottom}>
|
||||
<button className={styles.button} onClick={onCancel}>
|
||||
{cancelText}
|
||||
</button>
|
||||
<button className={styles.buttonPrimary} onClick={onConfirm}>
|
||||
{confirm}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user