signal-desktop/ts/components/CallingToast.tsx

33 lines
607 B
TypeScript
Raw Normal View History

// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import classNames from 'classnames';
type PropsType = {
isVisible: boolean;
onClick: () => unknown;
2022-11-18 00:45:19 +00:00
children?: JSX.Element | string;
};
export const DEFAULT_LIFETIME = 5000;
2022-11-18 00:45:19 +00:00
export function CallingToast({
isVisible,
onClick,
children,
2022-11-18 00:45:19 +00:00
}: PropsType): JSX.Element {
return (
<button
className={classNames(
'CallingToast',
!isVisible && 'CallingToast--hidden'
)}
type="button"
onClick={onClick}
>
{children}
</button>
);
}