prabhuignoto / react-chrono

🕑 Modern Timeline Component for React
https://react-chrono.prabhumurthy.com
MIT License
3.88k stars 206 forks source link

`hideControls` property does not work. #500

Open bbjbc opened 1 week ago

bbjbc commented 1 week ago

Describe the bug I want to remove the control bar at the top of the Chrono component. So I searched the API and used the hideControls property, but it does not disappear.

To Reproduce Steps to reproduce the behavior:

import { Chrono } from 'react-chrono';

const Timeline = () => {
  const items = [
    {
      title: 'January 2022',
      cardTitle: 'Event 1',
      cardSubtitle: 'Event 1 Subtitle',
      cardDetailedText: [
        'This is the first event on the timeline.',
        'And so on..',
      ],
    },
  ];

  return (
    <div className="w-full">
      <Chrono
        items={items.map((item) => ({
          ...item,
          cardDetailedText: item.cardDetailedText.map((text, index) => (
            <span key={index} className="text-sm">
              {text}
            </span>
          )),
        }))}
        mode="VERTICAL"
        hideControls
        theme={{ primary: '#4B5563', secondary: '#D1D5DB' }}
      />
    </div>
  );
};

export default Timeline;

As in the code above, I used the hideControls property properly. But it doesn't go away.

Expected behavior If used, it will be a really simple and convenient component.

Screenshots image

Desktop (please complete the following information):

Additional context It is being developed using React.tsx and is being developed as a mobile first screen. Is this by any chance a problem? hideControls="true", hideControls={true} I tried both of the above but they didn't work.

bbjbc commented 1 week ago

Same issue here! #478

Here's the PR for the new modified property! Sorry for creating a new issue.

However, I hope it will be added to the official website API document!🙏

GrayFrost commented 5 days ago

May I ask when this bug would be fixed?

bbjbc commented 5 days ago

May I ask when this bug would be fixed?

It would be a good idea to use the new API props disableToolbar. (as the next best solution)

Please refer to issue #478 😄

bbjbc commented 5 days ago

478 Looking at the changes, it appears that hideControls props has disappeared altogether.

Therefore, I think you can use disableToolbar in the future! 👍