| 1 |
import { useContext } from 'react'; |
| 2 |
import { OnboardingContext } from '../../context/context'; |
| 3 |
import Grid from 'elementor-app/ui/grid/grid'; |
| 4 |
import Notice from '../notice'; |
| 5 |
import FooterButtons from './footer-buttons'; |
| 6 |
|
| 7 |
export default function PageContentLayout( props ) { |
| 8 |
const { state } = useContext( OnboardingContext ); |
| 9 |
|
| 10 |
const printNotices = () => { |
| 11 |
return ( |
| 12 |
<> |
| 13 |
{ props.noticeState && <Notice noticeState={ props.noticeState } /> } |
| 14 |
{ state.proNotice && <Notice noticeState={ state.proNotice } /> } |
| 15 |
</> |
| 16 |
); |
| 17 |
}; |
| 18 |
|
| 19 |
return ( |
| 20 |
<> |
| 21 |
<Grid container alignItems="center" justify="space-between" className="e-onboarding__page-content"> |
| 22 |
<div className="e-onboarding__page-content-start"> |
| 23 |
<h1 className="e-onboarding__page-content-section-title"> |
| 24 |
{ props.title } |
| 25 |
</h1> |
| 26 |
<div className="e-onboarding__page-content-section-text"> |
| 27 |
{ props.children } |
| 28 |
</div> |
| 29 |
</div> |
| 30 |
<div className="e-onboarding__page-content-end"> |
| 31 |
<img src={ props.image } alt="Information" /> |
| 32 |
</div> |
| 33 |
</Grid> |
| 34 |
<div className="e-onboarding__notice-container"> |
| 35 |
{ props.noticeState || state.proNotice |
| 36 |
? printNotices() |
| 37 |
: <div className="e-onboarding__notice-empty-spacer" /> } |
| 38 |
</div> |
| 39 |
<FooterButtons actionButton={ props.actionButton } skipButton={ props.skipButton } /> |
| 40 |
</> |
| 41 |
); |
| 42 |
} |
| 43 |
|
| 44 |
PageContentLayout.propTypes = { |
| 45 |
title: PropTypes.string, |
| 46 |
children: PropTypes.any, |
| 47 |
image: PropTypes.string, |
| 48 |
actionButton: PropTypes.object, |
| 49 |
skipButton: PropTypes.object, |
| 50 |
noticeState: PropTypes.any, |
| 51 |
}; |
| 52 |
|