Don't check react-notification into the repo
This commit is contained in:
parent
3d25dc7f3c
commit
69767b0b75
10 changed files with 10 additions and 90 deletions
|
@ -5,7 +5,7 @@ import { httpErrorMessages } from 'soapbox/utils/errors';
|
|||
import type { SnackbarActionSeverity } from './snackbar';
|
||||
import type { AnyAction } from '@reduxjs/toolkit';
|
||||
import type { AxiosError } from 'axios';
|
||||
import type { NotificationObject } from 'soapbox/react-notification';
|
||||
import type { NotificationObject } from 'react-notification';
|
||||
|
||||
const messages = defineMessages({
|
||||
unexpectedTitle: { id: 'alert.unexpected.title', defaultMessage: 'Oops!' },
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import React from 'react';
|
||||
import { useIntl, MessageDescriptor } from 'react-intl';
|
||||
import { NotificationStack, NotificationObject, StyleFactoryFn } from 'react-notification';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
import { dismissAlert } from 'soapbox/actions/alerts';
|
||||
import { Button } from 'soapbox/components/ui';
|
||||
import { useAppSelector, useAppDispatch } from 'soapbox/hooks';
|
||||
import { NotificationStack, NotificationObject, StyleFactoryFn } from 'soapbox/react-notification';
|
||||
|
||||
import type { Alert } from 'soapbox/reducers/alerts';
|
||||
|
||||
|
|
BIN
app/soapbox/react-notification/defaultPropTypes.js
vendored
BIN
app/soapbox/react-notification/defaultPropTypes.js
vendored
Binary file not shown.
88
app/soapbox/react-notification/index.d.ts
vendored
88
app/soapbox/react-notification/index.d.ts
vendored
|
@ -1,88 +0,0 @@
|
|||
declare module 'soapbox/react-notification' {
|
||||
import { Component, ReactElement } from 'react';
|
||||
|
||||
interface StyleFactoryFn {
|
||||
(index: number, style: object | void, notification: NotificationProps): object;
|
||||
}
|
||||
|
||||
interface OnClickNotificationProps {
|
||||
/**
|
||||
* Callback function to run when the action is clicked.
|
||||
* @param notification Notification currently being clicked
|
||||
* @param deactivate Function that can be called to set the notification to inactive.
|
||||
* Used to activate notification exit animation on click.
|
||||
*/
|
||||
onClick?(notification: NotificationProps, deactivate: () => void): void;
|
||||
}
|
||||
|
||||
interface NotificationProps extends OnClickNotificationProps {
|
||||
/** The name of the action, e.g., "close" or "undo". */
|
||||
action?: string;
|
||||
/** Custom action styles. */
|
||||
actionStyle?: object;
|
||||
/** Custom snackbar styles when the bar is active. */
|
||||
activeBarStyle?: object;
|
||||
/**
|
||||
* Custom class to apply to the top-level component when active.
|
||||
* @default 'notification-bar-active'
|
||||
*/
|
||||
activeClassName?: string;
|
||||
/** Custom snackbar styles. */
|
||||
barStyle?: object;
|
||||
/** Custom class to apply to the top-level component. */
|
||||
className?: string;
|
||||
/**
|
||||
* Timeout for onDismiss event.
|
||||
* @default 2000
|
||||
*/
|
||||
dismissAfter?: boolean | number;
|
||||
/**
|
||||
* If true, the notification is visible.
|
||||
* @default false
|
||||
*/
|
||||
isActive?: boolean;
|
||||
/** The message or component for the notification. */
|
||||
message: string | ReactElement<NotificationProps>;
|
||||
/** Setting this prop to `false` will disable all inline styles. */
|
||||
style?: boolean;
|
||||
/** The title for the notification. */
|
||||
title?: string | ReactElement<any>;
|
||||
/** Custom title styles. */
|
||||
titleStyle?: object;
|
||||
|
||||
/**
|
||||
* Callback function to run when dismissAfter timer runs out
|
||||
* @param notification Notification currently being dismissed.
|
||||
*/
|
||||
onDismiss?(notification: NotificationProps): void;
|
||||
}
|
||||
|
||||
interface NotificationStackProps extends OnClickNotificationProps {
|
||||
/** Create the style of the actions. */
|
||||
actionStyleFactory?: StyleFactoryFn;
|
||||
/** Create the style of the active notification. */
|
||||
activeBarStyleFactory?: StyleFactoryFn;
|
||||
/** Create the style of the notification. */
|
||||
barStyleFactory?: StyleFactoryFn;
|
||||
/**
|
||||
* If false, notification dismiss timers start immediately.
|
||||
* @default true
|
||||
*/
|
||||
dismissInOrder?: boolean;
|
||||
/** Array of notifications to render. */
|
||||
notifications: NotificationObject[];
|
||||
/**
|
||||
* Callback function to run when dismissAfter timer runs out
|
||||
* @param notification Notification currently being dismissed.
|
||||
*/
|
||||
onDismiss?(notification: NotificationObject): void;
|
||||
}
|
||||
|
||||
export interface NotificationObject extends NotificationProps {
|
||||
key: number | string;
|
||||
}
|
||||
|
||||
export class Notification extends Component<NotificationProps, {}> {}
|
||||
|
||||
export class NotificationStack extends Component<NotificationStackProps, {}> {}
|
||||
}
|
BIN
app/soapbox/react-notification/index.js
vendored
BIN
app/soapbox/react-notification/index.js
vendored
Binary file not shown.
BIN
app/soapbox/react-notification/notification.js
vendored
BIN
app/soapbox/react-notification/notification.js
vendored
Binary file not shown.
BIN
app/soapbox/react-notification/notificationStack.js
vendored
BIN
app/soapbox/react-notification/notificationStack.js
vendored
Binary file not shown.
Binary file not shown.
|
@ -167,6 +167,7 @@
|
|||
"react-inlinesvg": "^3.0.0",
|
||||
"react-intl": "^5.0.0",
|
||||
"react-motion": "^0.5.2",
|
||||
"react-notification": "^6.8.5",
|
||||
"react-otp-input": "^2.4.0",
|
||||
"react-overlays": "^0.9.0",
|
||||
"react-popper": "^2.3.0",
|
||||
|
|
|
@ -9946,6 +9946,13 @@ react-motion@^0.5.2:
|
|||
prop-types "^15.5.8"
|
||||
raf "^3.1.0"
|
||||
|
||||
react-notification@^6.8.5:
|
||||
version "6.8.5"
|
||||
resolved "https://registry.yarnpkg.com/react-notification/-/react-notification-6.8.5.tgz#7ea90a633bb2a280d899e30c93cf372265cce4f0"
|
||||
integrity sha512-3pJPhSsWNYizpyeMeWuC+jVthqE9WKqQ6rHq2naiiP4fLGN4irwL2Xp2Q8Qn7agW/e4BIDxarab6fJOUp1cKUw==
|
||||
dependencies:
|
||||
prop-types "^15.6.2"
|
||||
|
||||
react-onclickoutside@^6.12.0:
|
||||
version "6.12.1"
|
||||
resolved "https://registry.yarnpkg.com/react-onclickoutside/-/react-onclickoutside-6.12.1.tgz#92dddd28f55e483a1838c5c2930e051168c1e96b"
|
||||
|
|
Loading…
Reference in a new issue