Skip to content

Commit

Permalink
feat: export ToasterPortal props
Browse files Browse the repository at this point in the history
  • Loading branch information
imagine10255 committed Sep 2, 2023
1 parent f4b5365 commit 5685550
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ToasterPortal/ToasterPortal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import {EStatus, IItem, THidden, TShow, TShowMulti} from '../types';
import ModalWithPortal from './ModalWithPortal';
import {elClassName} from '../config';
import Toaster from '../Toaster';
import {IToasterPortalProps} from './types';
import '../styles.css';


interface IState {
items: IItem[],
}
interface IProps {
timeout?: number,
}


/**
* Global var
Expand All @@ -24,14 +23,14 @@ export let toast: TShowMulti;
/**
* ToasterPortal
*/
class ToasterPortal extends React.Component<IProps, IState> {
class ToasterPortal extends React.Component<IToasterPortalProps, IState> {
static defaultProps = {
};
state: IState = {
items: [],
};

constructor(props: IProps) {
constructor(props: IToasterPortalProps) {
super(props);

// set global
Expand Down
1 change: 1 addition & 0 deletions src/ToasterPortal/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export {default, toast} from './ToasterPortal';
export * from './types';
3 changes: 3 additions & 0 deletions src/ToasterPortal/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface IToasterPortalProps {
timeout?: number,
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export {default as ToasterPortal, toast} from './ToasterPortal';
export {default as elClassName} from './el-class-name';
export * from './ToasterPortal';
export * from './types';

0 comments on commit 5685550

Please sign in to comment.