-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore(ui): migrate DateTimePicker to TypeScript #640
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: c946c0e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! So many lines in the component. 🚀
Added a few blocking improvements.
packages/ui-components/src/components/DateTimePicker/DateTimePicker.component.tsx
Outdated
Show resolved
Hide resolved
packages/ui-components/src/components/DateTimePicker/DateTimePicker.component.tsx
Outdated
Show resolved
Hide resolved
packages/ui-components/src/components/DateTimePicker/DateTimePicker.component.tsx
Outdated
Show resolved
Hide resolved
packages/ui-components/src/components/DateTimePicker/DateTimePicker.component.tsx
Outdated
Show resolved
Hide resolved
packages/ui-components/src/components/DateTimePicker/DateTimePicker.component.tsx
Show resolved
Hide resolved
packages/ui-components/src/components/DateTimePicker/DateTimePicker.component.tsx
Show resolved
Hide resolved
packages/ui-components/src/components/DateTimePicker/DateTimePicker.component.tsx
Show resolved
Hide resolved
packages/ui-components/src/components/DateTimePicker/DateTimePicker.component.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank You for the changes! 🚀 Just a few blocking changes again.
const fpRef = useRef<HTMLInputElement>(null) // the dom node flatpickr instance will be bound to | ||
const flatpickrInstanceRef = useRef<flatpickr.Instance | null>(null) // The actual flatpickr instance | ||
const calendarTargetRef = useRef(null) // The DOM node the flatpickr calendar should be rendered to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Blocking)
We need types everywhere here:
const fpRef = useRef<HTMLInputElement>(null) // the dom node flatpickr instance will be bound to | |
const flatpickrInstanceRef = useRef<flatpickr.Instance | null>(null) // The actual flatpickr instance | |
const calendarTargetRef = useRef(null) // The DOM node the flatpickr calendar should be rendered to | |
const fpRef = useRef<HTMLInputElement | null>(null) // The DOM node flatpickr instance will be bound to | |
const flatpickrInstanceRef = useRef<flatpickr.Instance | null>(null) // The actual flatpickr instance | |
const calendarTargetRef = useRef<HTMLDivElement | null>(null) // The DOM node the flatpickr calendar should be rendered to |
//if (instance) { | ||
instance?.destroy() | ||
setTheDate({}) | ||
flatpickrInstanceRef.current = null // Not sure if this is actually necessary? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Non-Blocking Suggestion)
I think it is, comment can be removed.
|
||
const destroyFlatpickrInstance = () => { | ||
const instance = flatpickrInstanceRef.current | ||
//if (instance) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Blocking)
Since this commented out code was introduced in this PR, please remove for cleaner code 🙏
instance?.destroy() | ||
setTheDate({}) | ||
flatpickrInstanceRef.current = null // Not sure if this is actually necessary? | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Blocking)
Since this commented out code was introduced in this PR, please remove for cleaner code 🙏
Summary
migrate DateTimePicker to TypeScript
Changes Made
Related Issues
Testing Instructions
npm i
npm run storybook
Checklist