diff --git a/packages/interface-default/src/index.tsx b/packages/interface-default/src/index.tsx index f653ffee..cdd37411 100644 --- a/packages/interface-default/src/index.tsx +++ b/packages/interface-default/src/index.tsx @@ -41,6 +41,7 @@ export interface ButtonProps { export interface ConsentManagerDefaultInterfaceDesignProps { useDefaultButtonForIntroduction?: boolean slideDuration?: number + noActionDelay?: number styles?: Styles animationStyles?: Styles ToggleButton?: React.ComponentType diff --git a/packages/interface-default/src/interface.tsx b/packages/interface-default/src/interface.tsx index 7d4d9099..2481d880 100644 --- a/packages/interface-default/src/interface.tsx +++ b/packages/interface-default/src/interface.tsx @@ -46,6 +46,7 @@ export const Interface: React.FC = ({ initialValues, onSubmit, useDefaultButtonForIntroduction = true, + noActionDelay = 4000, slideDuration = 700, styles = defaultStyles, CloseIcon = IoClose, @@ -139,6 +140,7 @@ export const Interface: React.FC = ({ slideDuration={slideDuration} CloseIcon={CloseIcon} Button={useDefaultButtonForIntroduction ? DefaultButton : Button} + noActionDelay={noActionDelay} /> )} diff --git a/packages/interface-default/src/introduction.tsx b/packages/interface-default/src/introduction.tsx index fccaed5a..bf47a99d 100644 --- a/packages/interface-default/src/introduction.tsx +++ b/packages/interface-default/src/introduction.tsx @@ -1,4 +1,10 @@ -import React, { MouseEvent, useCallback, useContext, useEffect, useState } from 'react' +import React, { + MouseEvent, + useCallback, + useContext, + useEffect, + useState, +} from 'react' import clsx from 'clsx' import { CSSTransition } from 'react-transition-group' import createActivityDetector from 'activity-detector-ssr' @@ -45,6 +51,10 @@ export const Introduction: React.FC = ({ // Listen for user interaction React.useEffect(() => { + if (noActionDelay === 0) { + setIsIdle(true) + return + } const activityDetector: ActivityDetector = createActivityDetector({ timeToIdle: noActionDelay, inactivityEvents: [],