2.3.0 • Published 3 years ago

@tdcerhverv/announcement v2.3.0

Weekly downloads
129
License
Apache-2.0
Repository
bitbucket
Last release
3 years ago

Announcement component

State

Usage

Import like this:

import { Announcement } from '@tdcerhverv/announcement';

Use like this:

<AnnouncementElement {...props}/>
<AnnouncementService {...props}/>
<AnnouncementPage {...props}/>

Note: The component uses SVG icons as React components. For this reason you must use something like @svgr/parcel-plugin-svgr (for Parcel) or svg-react-loader (for Webpack) depending on your application bundler. Both is added as a peer dependency, but you only need one of them.
The new selfservice website uses Parcel and Storybook uses Webpack if you need help and inspiration to set it up.

Props

export interface IAnnouncement {
  type: AnnouncementType;
  title: string;
  message: ReactNode;
  link?: string; // used in conjuction with linkText
  linkText?: string; // used in conjuction with link
  linkTarget?: '_blank' | '_self' | '_parent' | '_top';
  onClose?: () => void;
  className?: string;
}

Note: title is not required nor used for the small announcement.
Note: Both link and linkText must be supplied for the link to show.

And the AnnouncementType:

export type AnnouncementType =
  | 'empty'
  | 'info'
  | 'positive'
  | 'warning'
  | 'negative';

Detailed usage

TODO...

Tags

announcement, notification, alert, warning, info

2.3.0

3 years ago

2.2.1

3 years ago

2.2.2

3 years ago

2.2.0

3 years ago

2.1.0

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

5 years ago

1.0.0

5 years ago