// External imports import * as React from "react" // Internal imports import * as ce from "../../../helpers/componentEnhancer" import * as alertActions from "../../../actions/alert" export interface ParentProps {} interface StateProps {} interface DispatchProps { triggerAlert: (alert: ce.stl.Alert) => void } interface LocalState { updatingAlert: ce.stl.Alert } class AlertTester extends React.Component< ParentProps & StateProps & DispatchProps & ce.EnhancedPropsPrivate, LocalState > { componentDidMount() { // Alerts this.setState({ updatingAlert: new ce.stl.Alert({ message: l => l.dev.helloWorld(), progress: 0.1, autoDismissTimeout: null }) }) } render() { return (
) } } const stateMappings: ce.StateMappings = (s, props) => ({}) const dispatchMappings: ce.DispatchMappings = (d, props) => ({ triggerAlert: (alert: ce.stl.Alert) => { d(alertActions.request(alert)) } }) export default ((): React.ComponentType => ce.enhance(AlertTester, { stateMappings, dispatchMappings }))()