mirror of
https://github.com/proelements/proelements.git
synced 2026-04-18 10:02:16 +00:00
v3.33.1
This commit is contained in:
22
core/app/assets/js/hooks/use-feature-lock.js
Normal file
22
core/app/assets/js/hooks/use-feature-lock.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import ConnectButtonUI from '../ui/connect-button';
|
||||
import { htmlDecodeTextContent, replaceUtmPlaceholders } from '../utils';
|
||||
|
||||
export default function useFeatureLock( featureName ) {
|
||||
const appConfig = elementorAppProConfig[ featureName ] ?? {},
|
||||
isLocked = appConfig.lock?.is_locked ?? false;
|
||||
|
||||
const buttonText = htmlDecodeTextContent( appConfig.lock?.button.text );
|
||||
const buttonLink = replaceUtmPlaceholders(
|
||||
appConfig.lock?.button.url ?? '',
|
||||
appConfig.utms ?? {},
|
||||
);
|
||||
|
||||
const ConnectButton = () => (
|
||||
<ConnectButtonUI text={ buttonText } url={ buttonLink } />
|
||||
);
|
||||
|
||||
return {
|
||||
isLocked,
|
||||
ConnectButton,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user