Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

[PE-124] Update TrackerDetails to accept reference date#229

Merged
evanheisler merged 5 commits intomasterfrom
PE-124-update-trackerdetails-to-accept-date
May 30, 2023
Merged

[PE-124] Update TrackerDetails to accept reference date#229
evanheisler merged 5 commits intomasterfrom
PE-124-update-trackerdetails-to-accept-date

Conversation

@evanheisler
Copy link
Contributor

Changes

  • Adds optional prop to TrackerDetails and AdvancedTrackerDetails to receive a date
  • If the referenceDate is provided, the component uses that date instead of the current date
  • Prevents passing a referenceDate in the future
  • Adds knobs to storybook

Screenshots

Screen.Recording.2023-05-26.at.2.46.36.PM.mov

Comment on lines -53 to -56
useEffect(() => {
setDateRange(getInitialRange(dateRangeType));
}, [dateRangeType]);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sort of unrelated but noticed the potential here for unnecessary re-renders. I wouldn't expect this to be a prop that would change (basically just toggles between a calendar week and last 7 days) but it would fall under these conditions where useEffect isn't the best choice.

@evanheisler evanheisler merged commit f7a6254 into master May 30, 2023
@evanheisler evanheisler deleted the PE-124-update-trackerdetails-to-accept-date branch May 30, 2023 15:19
@github-actions
Copy link

🎉 This PR is included in version 1.28.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Has been released to the package repository (NPM, etc) label May 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

released Has been released to the package repository (NPM, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants