| 1 |
import {__} from '@wordpress/i18n'; |
| 2 |
import Badge from './components/Badge'; |
| 3 |
import './styles.scss'; |
| 4 |
import {useDismiss} from './hooks/useDismiss'; |
| 5 |
import getWindowData from '../index'; |
| 6 |
import LeftContentSection from './components/Sections/LeftContentSection'; |
| 7 |
import RightContentSection from './components/Sections/RightContentSection'; |
| 8 |
|
| 9 |
/** |
| 10 |
* @since 3.0.0 |
| 11 |
*/ |
| 12 |
export default function App() { |
| 13 |
const {showBanner, dismissBanner} = useDismiss(); |
| 14 |
const {assets} = getWindowData(); |
| 15 |
|
| 16 |
if (!showBanner) { |
| 17 |
return; |
| 18 |
} |
| 19 |
|
| 20 |
return ( |
| 21 |
<div className={'givewp-welcome-banner'}> |
| 22 |
<div className={'givewp-welcome-banner__dismiss-container'}> |
| 23 |
<Badge |
| 24 |
variant={'primary'} |
| 25 |
caption={__('UPDATED', 'give')} |
| 26 |
iconSrc={`${assets}/green-circle-check-icon.svg`} |
| 27 |
alt={'check-mark'} |
| 28 |
/> |
| 29 |
<button onClick={dismissBanner}> |
| 30 |
<img src={`${assets}/close-icon.svg`} alt={'dismiss'} /> |
| 31 |
</button> |
| 32 |
</div> |
| 33 |
|
| 34 |
<div className={'givewp-welcome-banner__content-container'}> |
| 35 |
<LeftContentSection assets={assets} /> |
| 36 |
<RightContentSection assets={assets} /> |
| 37 |
</div> |
| 38 |
</div> |
| 39 |
); |
| 40 |
} |
| 41 |
|