@codeftw/future-web-ui-alert

1.0.5 • Public • Published

UI Alert

npm version

Installation

npm install @codeftw/future-web-ui-alert

Usage

  • Add AlertProvider wrapping your App
import { AlertProvider } from '@codeftw/future-web-ui-alert';


  render(
    <ApolloProvider client={client}>
      <MuiThemeProvider theme={theme}>
        <TunnelProvider>
          <AlertProvider>
            <BrowserRouter>
              <AppContainer/>
            </BrowserRouter>
          </AlertProvider>
        </TunnelProvider>
      </MuiThemeProvider>
    </ApolloProvider>,
    document.getElementById('app')
  );
  • Add the Alert component somewhere in your App
import { Alert } from '@codeftw/future-web-ui-alert';

<Alert />
  • Use our HOC withAlert to have access to showAlert function
import { withAlert } from '@codeftw/future-web-ui-alert';

const AddTask = withAlert(({showAlert}) => {
   ...
   showAlert('Task added');
   ...
});

Readme

Keywords

Package Sidebar

Install

npm i @codeftw/future-web-ui-alert

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

4.83 kB

Total Files

3

Last publish

Collaborators

  • filipenevola
  • tgmarinho