Skip to content

Commit bb3c0d8

Browse files
committed
refactor: rename type ShowNotification to ShowNotificationParams
1 parent 2db958b commit bb3c0d8

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Notifier.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
} from './constants';
2020
import {
2121
ShowParams,
22-
ShowNotification,
22+
ShowNotificationParams,
2323
StateInterface,
2424
EndCallback,
2525
NotifierInterface,
@@ -30,17 +30,17 @@ export const Notifier: NotifierInterface = {
3030
hideNotification: () => {},
3131
};
3232

33-
export class NotifierRoot extends React.PureComponent<ShowNotification, StateInterface> {
33+
export class NotifierRoot extends React.PureComponent<ShowNotificationParams, StateInterface> {
3434
private isShown: boolean;
3535
private isHiding: boolean;
3636
private hideTimer: any;
3737
private showParams: ShowParams | null;
38-
private callStack: Array<ShowNotification>;
38+
private callStack: Array<ShowNotificationParams>;
3939
private readonly translateY: Animated.Value;
4040
private readonly translateYInterpolated: Animated.AnimatedInterpolation;
4141
private readonly onGestureEvent: (...args: any[]) => void;
4242

43-
constructor(props: ShowNotification) {
43+
constructor(props: ShowNotificationParams) {
4444
super(props);
4545

4646
this.state = {
@@ -104,7 +104,7 @@ export class NotifierRoot extends React.PureComponent<ShowNotification, StateInt
104104
this.onStartHiding();
105105
}
106106

107-
public showNotification(functionParams: ShowNotification) {
107+
public showNotification(functionParams: ShowNotificationParams) {
108108
const params = {
109109
...this.props,
110110
...functionParams,

src/NotifierWrapper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
22
import { NotifierRoot } from './Notifier';
3-
import { ShowNotification } from './types';
3+
import { ShowNotificationParams } from './types';
44

5-
interface NotifierWrapperProps extends ShowNotification {
5+
interface NotifierWrapperProps extends ShowNotificationParams {
66
children: React.ReactNode;
77
}
88

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export type QueueMode = 'immediate' | 'next' | 'standby' | 'reset';
2424

2525
type ComponentProps = NotificationComponentProps | AlertComponentProps | object;
2626

27-
export interface ShowNotification extends ShowParams {
27+
export interface ShowNotificationParams extends ShowParams {
2828
title?: string; // null
2929
description?: string; // null
3030
swipeEnabled?: boolean; // true
@@ -46,6 +46,6 @@ export type EndResult = { finished: boolean };
4646
export type EndCallback = (result: EndResult) => void;
4747

4848
export interface NotifierInterface {
49-
showNotification: (params: ShowNotification) => void;
49+
showNotification: (params: ShowNotificationParams) => void;
5050
hideNotification: (onHidden?: EndCallback) => void;
5151
}

0 commit comments

Comments
 (0)