-
Notifications
You must be signed in to change notification settings - Fork 10
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
#331 Datepicker component #300
Conversation
From my perspective this component is perfect! There are few things that we should improve: |
Component looks great! Awesome work @kamilmateusiak!
|
|
Sorry! We've discussed that internally and decided to keep this option, I forgot to change the task description :( |
import { IDatePickerProps } from './types'; | ||
import { isDateWithinRange } from './helpers'; | ||
|
||
const baseClass = 'date-picker'; |
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.
I noticed that I used className without lc-
prefix. Please change it :)
394513d
to
9433420
Compare
This PR is the work of Kamil who agreed to help us out with the DatePicker component.
It is refreshed version of DatePicker from the previous Design System. It still does not allow to enter date manually but other than that should be fully functional. |
packages/react-components/src/components/Datepicker/RangeDatePicker.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/src/components/Datepicker/DatePicker.spec.tsx
Outdated
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.
There is a lot of logic inside useEffects
on props change, and IMO it's not correct usage of effects. This logic should be fired when calling some onChange
packages/react-components/src/components/Datepicker/DatePicker.spec.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/src/components/Datepicker/DatePicker.spec.tsx
Outdated
Show resolved
Hide resolved
|
||
const [month, setMonth] = React.useState(propsMonth || new Date()); | ||
|
||
React.useEffect(() => { |
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.
do we need to supply React.
namespace everywhere? you could import it directly
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.
It is a convention used across all components - I can change it, but what do others have to say about it? @marcinsawicki @sgraczyk
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.
We can drop importing * as React
if whenever possible
packages/react-components/src/components/Datepicker/DatePicker.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/src/components/Datepicker/DatePicker.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/src/components/Datepicker/RangeDatePicker.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/src/components/Datepicker/RangeDatePicker.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/src/components/Datepicker/RangeDatePicker.tsx
Outdated
Show resolved
Hide resolved
I've had a screen-sharing session with Marek, and we have concluded that changing this would require rewriting a big chunk of code. It will stay at it is now until the component is rewritten to React DayPicker v8 |
c839a66
to
f24b312
Compare
d6a1003
to
67014ba
Compare
https://github.com/livechat/design-system/pull/299/files