-
Notifications
You must be signed in to change notification settings - Fork 12
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
date picker wrapper for react-day-picker #346
base: master
Are you sure you want to change the base?
Conversation
<Input | ||
value={selectedDay.toISOString().split('T')[0]} | ||
onClick={() => setShowInlineCalendar(true)} | ||
/> | ||
{showInlineCalendar && ( | ||
<Paper | ||
style={{ | ||
boxShadow: '0px 0px 2px 2px rgb(0 0 0 / 20%)', | ||
display: 'table', | ||
padding: '2px', | ||
position: 'absolute', | ||
}} | ||
> | ||
<DatePicker | ||
showOutsideDays | ||
onDayClick={handleInlineDateClick} | ||
selectedDays={selectedDay} | ||
/> | ||
</Paper> | ||
)} |
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.
This is an example of what it might look like to extend the DatePicker component to make it inline.
if (passedProps.classNames) { | ||
Object.entries(passedProps.classNames).forEach((classes) => { | ||
if (classes.length === 2) { | ||
styleOverride[classes[0]] = `${styleOverride[classes[0]]} ${ | ||
classes[1] | ||
}`; | ||
} | ||
}); | ||
} |
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.
This pass-through Date-Picker component allows consuming apps to overwrite specific attribute (e.g. footer attribute) of the class object without overriding the entire classNames
object.
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.
sorry, didn't realize you were still waiting for approvals on this. lgtm!
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.
Sorry for the delay to review
No description provided.