# react-site-announcement

> Common react component for site announcements with role management

Latest version **1.0.3** (published 2020-07-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-site-announcement
pnpm add react-site-announcement
yarn add react-site-announcement
bun add react-site-announcement
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-07-12 |
| First published | 2020-07-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sanskar Gupta |
| Maintainers | snskr95 |

## Links

- npm: https://www.npmjs.com/package/react-site-announcement
- Repository: https://github.com/Sanskar95/react-site-announcement
- Homepage: https://github.com/Sanskar95/react-site-announcement#readme
- Issues: https://github.com/Sanskar95/react-site-announcement/issues
- npm.io page: https://npm.io/package/react-site-announcement

## Dependencies (7)

- [he](https://npm.io/package/he.md) ^1.2.0
- [react](https://npm.io/package/react.md) ^16.13.1
- [draft-js](https://npm.io/package/draft-js.md) ^0.11.6
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.10.4
- [@material-ui/core](https://npm.io/package/@material-ui/core.md) ^4.11.0
- [@material-ui/icons](https://npm.io/package/@material-ui/icons.md) ^4.9.1
- [react-draft-wysiwyg](https://npm.io/package/react-draft-wysiwyg.md) ^1.14.5

## Recent versions

- 1.0.3 (latest) — 2020-07-12
- 1.0.2 — 2020-07-11
- 1.0.1 — 2020-07-11
- 1.0.0 — 2020-07-11

## README

## React Site Announcement

This component is used to display website wide announcements like latest features pushed on the top.It uses react-draft-wysiwyg rich text content to edit and display text.

## Using the Component

To be able to use the component, follow the steps below:

- Install react-site-announcement in your application, this will install the latest release:
`npm i react-site-announcement@latest --save`

- Import the component:
`import { ReactSiteAnnouncement } from 'react-site-announcement'`
<CommonApplicationAlert isAdmin data={this.state.alertData} saveMessage={this.putMessage}/> }
## PROPS
 There are 4 methods under the snackToast API.
 1) isAdmin - A flag to indicate if the logged in user can edit the message.If this flag is set to yes , user can edit existing text , add new text, If set to false user will only be able to see the text.
 2) data - Accepts rich html text as input ,for eg: "{&#34;blocks&#34;:[{&#34;key&#34;:&#34;13trq&#34;,&#34;text&#34;:&#34;Important message!&#34;,&#34;type&#34;:&#34;unstyled&#34;,&#34;depth&#34;:0,&#34;inlineStyleRanges&#34;:[],&#34;entityRanges&#34;:[],&#34;data&#34;:{}}],&#34;entityMap&#34;:{}}"
 3) saveMessage - A function as callback that will be responsible for saving the messages to the backend , for eg:
 `handleMessage=async (message) => {
      await saveMessageToBackend(message);
    }`
 
        
     
## Example
     <ReactSiteAnnouncement isAdmin={true} data={this.state.alertData} saveMessage={this.handleMessage}/>

---
_Source: https://npm.io/package/react-site-announcement · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
