mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Donations: Show progress, error and verify dialogs
This commit is contained in:
@@ -1,26 +1,41 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
import type { LocalizerType } from '../types/Util';
|
||||
import { Modal } from './Modal';
|
||||
import { SpinnerV2 } from './SpinnerV2';
|
||||
import { SECOND } from '../util/durations';
|
||||
|
||||
export type PropsType = {
|
||||
i18n: LocalizerType;
|
||||
onClose: () => void;
|
||||
onWaitedTooLong: () => void;
|
||||
};
|
||||
|
||||
export function DonationProgressModal(props: PropsType): JSX.Element {
|
||||
const { i18n, onClose } = props;
|
||||
const { i18n, onWaitedTooLong } = props;
|
||||
|
||||
useEffect(() => {
|
||||
let timeout: NodeJS.Timeout | undefined = setTimeout(() => {
|
||||
timeout = undefined;
|
||||
onWaitedTooLong();
|
||||
}, SECOND * 30);
|
||||
|
||||
return () => {
|
||||
if (timeout) {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
};
|
||||
}, [onWaitedTooLong]);
|
||||
|
||||
return (
|
||||
<Modal
|
||||
i18n={i18n}
|
||||
moduleClassName="DonationProgressModal"
|
||||
modalName="DonationProgressModal"
|
||||
onClose={onClose}
|
||||
noMouseClose
|
||||
onClose={() => undefined}
|
||||
>
|
||||
<SpinnerV2 size={58} strokeWidth={8} />
|
||||
<div className="DonationProgressModal__text">
|
||||
|
||||
Reference in New Issue
Block a user