/* * Copyright 2015 Palantir Technologies, Inc. All rights reserved. * Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy * of the license at https://github.com/palantir/blueprint/blob/master/LICENSE * and https://github.com/palantir/blueprint/blob/master/PATENTS */ import * as React from "react"; import { Alert, Button, Intent, IToaster, Toaster } from "@blueprintjs/core"; import BaseExample from "./common/baseExample"; export interface IAlertExampleState { isOpen?: boolean; isOpenError?: boolean; } export class AlertExample extends BaseExample<{}> { public state: IAlertExampleState = { isOpen: false, isOpenError: false, }; private toaster: IToaster; private message: JSX.Element = (
filename was moved to Trash
); public componentWillMount() { this.toaster = Toaster.create(); } protected renderExample() { return (
); } private handleOpenError = () => this.setState({ isOpenError: true }); private handleCloseError = () => this.setState({ isOpenError: false }); private handleOpen = () => this.setState({ isOpen: true }); private handleMoveClose = () => { this.setState({ isOpen: false }); this.toaster.show({ className: this.props.getTheme(), message: this.message, }); } private handleClose = () => this.setState({ isOpen: false }); }