Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "wordpress-plugins/real-cookie-banner/src/public/ts/components/config/licensing/consumer"

Index

Variables

Const ConfigLicensingConsumer

ConfigLicensingConsumer: FC<{ withinModal?: boolean }> = observer(({ withinModal = false }) => {const {pluginUpdateStore: { pluginUpdates }} = useRpmStores();const { optionStore, checklistStore } = useStores();const {slug,others: { isPro, showLicenseFormImmediate },publicUrl} = optionStore;const pluginUpdate = pluginUpdates.get(slug);const handleLicenseUpdated = useCallback(() => {checklistStore.fetchChecklist();refreshQueue();// When form is shown directly after first usage, return to dashboardoptionStore.setShowLicenseFormImmediate(false, true);}, [checklistStore, optionStore]);const handleLicenseDeactivated = useCallback(() => {checklistStore.fetchChecklist();// When form is shown directly after first usage, return to dashboardoptionStore.setShowLicenseFormImmediate(false, false);}, [checklistStore, optionStore]);const handleLicenseSkip = useCallback(() => {optionStore.setShowLicenseFormImmediate(false, false);pluginUpdate.skip();}, [pluginUpdate, optionStore]);// Automatically skip if form already interacted (e.g. browser back cache issue)useEffect(() => {if (showLicenseFormImmediate && pluginUpdate?.hasInteractedWithFormOnce) {handleLicenseSkip();}}, [pluginUpdate, showLicenseFormImmediate, handleLicenseSkip]);const freeVersionParagraph = _i(__("Before we start configuring your cookie banner, you can {{strong}}obtain your free license to enjoy all the benefits{{/strong}} of the free version of Real Cookie Banner. The cookies are already waiting for you. Get started now!"),{strong: <strong />});return (<>{showLicenseFormImmediate && (<div style={{ maxWidth: 650, textAlign: "center", margin: "0 auto" }}>{!withinModal && (<Avatarsrc={`${publicUrl}images/logos/real-cookie-banner.svg`}shape="square"size={130}style={{ backgroundColor: "white", padding: 25, borderRadius: 999, marginBottom: 10 }}/>)}{!withinModal && !isPro && (<p style={{ fontSize: 15, margin: "0 auto 20px" }}>{freeVersionParagraph}</p>)}</div>)}<Cardtitle={withinModal || !pluginUpdate ? undefined : (<>{isPro || pluginUpdate.isLicensed ? __("License activation") : __("Get your free license")}{" "}{!isPro && !showLicenseFormImmediate && (<LearnMoreTagurl={__("https://devowl.io/knowledge-base/real-cookie-banner-upgrade-free-to-pro-version/")}label={__("Upgrade to PRO version")}/>)}</>)}bordered={!withinModal}><Space direction="vertical" size="large">{withinModal && !isPro && (<p className="description" style={{ fontWeight: "bold" }}>{freeVersionParagraph}</p>)}<PluginUpdateEmbedformProps={{onSave: handleLicenseUpdated,// Skip remote errors and move to dashboard immediatelyonFailure: showLicenseFormImmediate && !isPro ? handleLicenseSkip : undefined,footer: (<Form.Itemstyle={{margin: "25px 0 0",textAlign: showLicenseFormImmediate ? "center" : undefined}}><inputtype="submit"className="button button-primary"value={showLicenseFormImmediate? isPro? __("Activate license & continue"): __("Activate free license & Continue"): __("Save")}/></Form.Item>)}}listProps={{onDeactivate: handleLicenseDeactivated}}slug={slug}/></Space></Card>{pluginUpdate && showLicenseFormImmediate && (<div style={{ textAlign: "center", marginBottom: 20, marginTop: withinModal ? 0 : 20 }}><a className="button-link" onClick={handleLicenseSkip}>{isPro? __("Continue without regular updates and without any support"): __("Continue without any support and without e.g. discount announcements")}</a></div>)}</>);})

Generated using TypeDoc