reactour icon indicating copy to clipboard operation
reactour copied to clipboard

How can we change the clipPath height using any props

Open aliabbas-2012 opened this issue 8 months ago • 3 comments

image Hello I am not able to change the height of clipPath and <rect x="0" y="0" width="1846" height="15"></rect> Because my top navbar is fixed every time the first step overlaps navbar

My code is

import React, { useEffect } from 'react';
import { useRouter } from 'next/router';
import { useLocalStorage } from 'react-use';
import { useTranslate } from '@hooks';
import { getTourSteps } from '@data';
import Loadable from 'react-loadable';

const Component = Loadable({
  loader: () => import('reactour'),
  loading: () => null,
});

const Tour = ({ isOpen, onToggle }) => {
  const { tHtml } = useTranslate('common');
  const router = useRouter();
  const [key, steps] = getTourSteps(router.pathname, tHtml);
  const [value, setValue] = useLocalStorage(`tour-${key}`, 'false');

  const doNothing = () => {};

  const disableBody = () => {
    document.body.classList.add('tour-on');
  };

  const handleClose = () => {
    document.body.classList.remove('tour-on');
    onToggle();
    setValue('true');
  };

  useEffect(() => {
    if (!isOpen && value === 'false') onToggle();
  }, [value, onToggle, isOpen]);

  return (
    !!steps &&
    isOpen && (
      <Component
        closeWithMask={false}
        disableInteraction
        rounded={4}
        steps={steps}
        isOpen={isOpen}
        onRequestClose={handleClose}
        onClickMask={doNothing}
        onClickHighlighted={doNothing}
        onAfterOpen={disableBody}
        padding={{ 
          mask: 10, 
          popover: [5, 10], 
          wrapper: [10,50,0,0] 
        }}
      />
    )
  );
};

export default Tour;

I provided the padding but its not working

aliabbas-2012 avatar Oct 11 '23 10:10 aliabbas-2012