give
/
src
/
Campaigns
/
resources
/
admin
/
components
/
CampaignDetailsPage
/
Components
/
Notices
/
CampaignNotice.tsx
give
/
src
/
Campaigns
/
resources
/
admin
/
components
/
CampaignDetailsPage
/
Components
/
Notices
Last commit date
ArchivedCampaignNotice.tsx
1 year ago
CampaignNotice.tsx
1 year ago
DefaultFormNotice.tsx
1 year ago
DraftCampaignPageNotice.tsx
1 year ago
Notices.module.scss
9 months ago
CampaignNotice.tsx
41 lines
| 1 | import cx from 'classnames'; |
| 2 | import {ExternalLink} from '@wordpress/components'; |
| 3 | import {CloseIcon} from '@givewp/campaigns/admin/components/Icons'; |
| 4 | |
| 5 | import styles from './Notices.module.scss'; |
| 6 | |
| 7 | interface NoticeProps { |
| 8 | title: string; |
| 9 | description: string; |
| 10 | handleDismiss?: () => void |
| 11 | type: 'campaignSettings' | 'campaignList' | 'campaignForm'; |
| 12 | linkText?: string; |
| 13 | linkHref?: string; |
| 14 | } |
| 15 | |
| 16 | export default ({title, description, type, linkHref, linkText, handleDismiss}: NoticeProps) => ( |
| 17 | <div className={cx(styles['tooltip'], styles[type])}> |
| 18 | {handleDismiss && ( |
| 19 | <div className={styles['close']} onClick={() => handleDismiss()}> |
| 20 | <CloseIcon /> |
| 21 | </div> |
| 22 | )} |
| 23 | <div> |
| 24 | <h3> |
| 25 | {title} |
| 26 | </h3> |
| 27 | <div className={styles['content']}> |
| 28 | {description} |
| 29 | </div> |
| 30 | </div> |
| 31 | {linkText && ( |
| 32 | <div className={styles['content']}> |
| 33 | <ExternalLink href={linkHref}> |
| 34 | {linkText} |
| 35 | </ExternalLink> |
| 36 | </div> |
| 37 | )} |
| 38 | </div> |
| 39 | ) |
| 40 | |
| 41 |