-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/ timeline x days view #1885
Conversation
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.
Looks good overall, I reviewed most of it (:
But I think it's worth finalizing the API (see my comments) before we continue.
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.
See my new comments
In general notice where you create data that can affect the renders
See which data you need to memoize and which can be kept as ref
@@ -44,6 +44,8 @@ export interface CalendarContextProviderProps extends ViewProps { | |||
disabledOpacity?: number; | |||
/** The number of days to present in the timeline calendar */ | |||
numberOfDays?: number; | |||
/** The left inset of the timeline calendar (sidebar width), default is 72 */ | |||
leftInset?: number; |
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.
Does it make sense to call this prop timelineLeftInset
or timelineSidebarWidth
- this way the prop name also hints it's only relevant to Timeline. leftInset
feels too general
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.
Changed to timelineLeftInset
src/expandableCalendar/index.tsx
Outdated
@@ -98,7 +98,7 @@ const headerStyleOverride = { | |||
*/ | |||
|
|||
const ExpandableCalendar = (props: ExpandableCalendarProps) => { | |||
const {date, setDate, numberOfDays = 1} = useContext(Context); | |||
const {date, setDate, numberOfDays = 1, leftInset = 72} = useContext(Context); |
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're setting the 72
default values in several places.
if we'll need to change it in the future we might miss one instance and have a bug.
Can we maybe set its default once in the context value?
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.
Done :)
@ethanshar @lidord-wix Don't you want to merge this one? |
@Inbal-Tish no, it requires a QA session |
Timeline x days view
To see the changes, please uncomment line # 242 in the timelineCalendarScreen (and you can change it to any other number from 1 to 7)
And sorry about this big PR 馃檲
WOAUILIB-2613