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

date picker wrapper for react-day-picker #346

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lihnick
Copy link
Collaborator

@lihnick lihnick commented Oct 22, 2021

No description provided.

Comment on lines +540 to +559
<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>
)}
Copy link
Collaborator Author

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.

Comment on lines +65 to +73
if (passedProps.classNames) {
Object.entries(passedProps.classNames).forEach((classes) => {
if (classes.length === 2) {
styleOverride[classes[0]] = `${styleOverride[classes[0]]} ${
classes[1]
}`;
}
});
}
Copy link
Collaborator Author

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.

Copy link
Collaborator

@dkordik dkordik left a 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!

Copy link
Contributor

@ManoloAlvarezForo ManoloAlvarezForo left a 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

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.

3 participants