Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to hide time caption #5100

Merged
merged 4 commits into from
Sep 19, 2024
Merged

Conversation

Qubitza
Copy link

@Qubitza Qubitza commented Sep 19, 2024

Description

Linked issue: #5099

Problem
It was previously not possible to completely hide the caption of the time picker.

Changes
Added showTimeCaption option to DatePicker to hide the time caption.
Added Hide Time Caption example to the docs.
Added tests to check custom caption text and hidden state.

Screenshots

image

To reviewers

Contribution checklist

  • I have followed the contributing guidelines.
  • I have added sufficient test coverage for my changes.
  • I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

✅ This pull request was sent to the PullRequest network for review. Expert reviewers are now being matched to your request based on the code's requirements. Stay tuned!

What to expect from this code review:
  • Comments posted to any areas of potential concern or improvement.
  • Detailed feedback or actions needed to resolve issues that are found.
  • Turnaround times vary, but we aim to be swift.

@Qubitza you can click here to see the review status or cancel the code review job.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

PullRequest Breakdown

Reviewable lines of change

+ 80
- 14

43% TSX
37% TSX (tests)
20% JavaScript

Type of change

Feature - These changes are adding a new feature or improvement to existing code.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

I have no concerns; the change seems correct as-is.

Image of Jacob Jacob


Reviewed with ❤️ by PullRequest

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

This looks like it'll do what the description says. Thank you for adding a test and an example for this. I left one nit comment that you can treat as non-blocking. Nice job!

Image of Joey G Joey G


Reviewed with ❤️ by PullRequest

@@ -250,6 +252,27 @@ export default class Time extends Component<TimeProps, TimeState> {
});
};

renderTimeCaption = (): JSX.Element => {
Copy link

Choose a reason for hiding this comment

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

nit:

Stylistically, I feel like early returns are easier to follow than ternaries. I would consider using an early return here instead to improve readability:

if (this.props.showTimeCaption === false) {
   return <></>
}

return (
...
)

🔹 Improve Readability (Nice to have)

Image of Joey G Joey G

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.89%. Comparing base (f75e1e6) to head (342d370).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5100   +/-   ##
=======================================
  Coverage   96.89%   96.89%           
=======================================
  Files          29       29           
  Lines        3346     3350    +4     
  Branches     1408     1409    +1     
=======================================
+ Hits         3242     3246    +4     
  Misses        102      102           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@martijnrusschen martijnrusschen merged commit 3e28fca into Hacker0x01:main Sep 19, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants