BannerAd.jsx
1 year ago
CodeAd.jsx
1 year ago
Congrats.jsx
1 year ago
GoogleAdsense.jsx
1 year ago
Step1.jsx
1 year ago
Step1.jsx
82 lines
| 1 | /** |
| 2 | * External Dependencies |
| 3 | */ |
| 4 | import { wizard } from '@advancedAds/i18n'; |
| 5 | |
| 6 | /** |
| 7 | * Internal Dependencies |
| 8 | */ |
| 9 | import { useWizard } from '@components/wizard'; |
| 10 | import RadioList from '@components/inputs/RadioList'; |
| 11 | import IconAdSense from '../../icons/AdSense'; |
| 12 | import IconCode from '../../icons/Code'; |
| 13 | import IconImage from '../../icons/Image'; |
| 14 | |
| 15 | export default function Step1({ setOptions }) { |
| 16 | const { nextStep } = useWizard(); |
| 17 | |
| 18 | const taskOptions = [ |
| 19 | { |
| 20 | label: ( |
| 21 | <> |
| 22 | <IconAdSense /> |
| 23 | <span>{wizard.firstStep.taskAdSense}</span> |
| 24 | </> |
| 25 | ), |
| 26 | value: 'google_adsense', |
| 27 | }, |
| 28 | { |
| 29 | label: ( |
| 30 | <> |
| 31 | <IconImage /> |
| 32 | <span>{wizard.firstStep.taskImage}</span> |
| 33 | </> |
| 34 | ), |
| 35 | value: 'ad_image', |
| 36 | }, |
| 37 | { |
| 38 | label: ( |
| 39 | <> |
| 40 | <IconCode /> |
| 41 | <span>{wizard.firstStep.taskCode}</span> |
| 42 | </> |
| 43 | ), |
| 44 | value: 'ad_code', |
| 45 | }, |
| 46 | ]; |
| 47 | |
| 48 | return ( |
| 49 | <> |
| 50 | <p className="font-medium mt-0">{wizard.firstStep.stepHeading}</p> |
| 51 | <p className="mt-4 font-medium"> |
| 52 | <label className="advads-input-radio" htmlFor="agreement"> |
| 53 | <input |
| 54 | type="checkbox" |
| 55 | name="agreement" |
| 56 | id="agreement" |
| 57 | onChange={(event) => |
| 58 | setOptions('agreement', event.target.value) |
| 59 | } |
| 60 | /> |
| 61 | <span |
| 62 | dangerouslySetInnerHTML={{ |
| 63 | __html: wizard.firstStep.agreementText, |
| 64 | }} |
| 65 | /> |
| 66 | </label> |
| 67 | </p> |
| 68 | <h2>{wizard.firstStep.inputTitle}</h2> |
| 69 | <RadioList |
| 70 | id="task" |
| 71 | className="!mb-0" |
| 72 | isButton |
| 73 | options={taskOptions} |
| 74 | onChange={(value) => { |
| 75 | setOptions('taskOption', value); |
| 76 | nextStep(); |
| 77 | }} |
| 78 | /> |
| 79 | </> |
| 80 | ); |
| 81 | } |
| 82 |