BoldSign®Effortlessly integrate e-signatures into your app with the BoldSign® API. Create a sandbox account!
export class Default extends SampleBase {
constructor() {
super(...arguments);
this.toasts = [
{
title: "Warning !",
content: "There was a problem with your network connection.",
cssClass: "e-toast-warning"
},
{
title: "Success !",
content: "Your message has been sent successfully.",
cssClass: "e-toast-success"
},
{
title: "Error !",
content: "A problem has been occurred while submitting your data.",
cssClass: "e-toast-danger"
},
{
title: "Information !",
content: "Please read the comments carefully.",
cssClass: "e-toast-info"
}
];
this.timeOutDelay = 600;
this.toastFlag = 0;
this.position = { X: "Right", Y: "Bottom" };
}
toastCreated() {
this.toastInstance.show(this.toasts[this.toastFlag]);
++this.toastFlag;
}
toastShow() {
setTimeout(() => {
this.toastInstance.show(this.toasts[this.toastFlag]);
++this.toastFlag;
if (this.toastFlag === this.toasts.length) {
this.toastFlag = 0;
}
}, this.timeOutDelay);
}
btnClick() {
this.toastShow();
}
render() {
return (
<div>
<ButtonComponent
cssClass="e-primary"
onClick={(this.btnClick = this.btnClick.bind(this))}
>
{" "}
Show Toast{" "}
</ButtonComponent>
<ToastComponent
ref={toast => (this.toastInstance = toast)}
position={this.position}
created={(this.toastCreated = this.toastCreated.bind(this))}
/>
</div>
);
}
} |
this.toastInstance.show({
title: "First Toast Created",
content: "First Toast content",
cssClass: "e-toast-warning"
}
); |
31 | if (!props.staticContext) {
32 | this.unlisten = props.history.listen(location => {
33 | if (this._isMounted) {
> 34 | this.setState({ location });
| ^ 35 | } else {
36 | this._pendingLocation = location;
37 | }