Refactor DateSeparator using MVVM and move to shared-components#32482
Refactor DateSeparator using MVVM and move to shared-components#32482rbondesson wants to merge 20 commits intoelement-hq:developfrom
Conversation
| this.updateSnapshot(); | ||
| }; | ||
|
|
||
| private renderJumpToDateMenu(label: string): React.ReactElement { |
There was a problem hiding this comment.
Rendering out the UI is part of the view's job so this code should be moved to DateSeparatorView.
You could add a property to the snapshot, say jumpToDateEnabled and then have the view render out two different sub-views based on that snapshot value:
if(jumpToDateEnabled) {
return <SimpleDateSeparatorView vm={vm} />;
}
else {
return <JumpDateSeparatorView vm={vm} />;
}There was a problem hiding this comment.
The components rendered in jumpToDateMenu are currently not present in shared components.
ContextMenuTooltipButton, IconizedContextMenu, IconizedContextMenuOptionList, IconizedContextMenuOption add JumpToDatePicker. The JumpToDatePicker component is on the list of components to migrate, but the others are not.
I could create a new component for jumpToDateMenu, but it will be an element-web component, or I can leave as is. Which way do you prefer?
…here manual handling is preferrable over wrapper component.
…/element-web into refactor/date-separator
Checklist
public/exportedsymbols have accurate TSDoc documentation.Refactor and move DateSeparator to shared-components
Summary
DateSeparatorcomponent to@element-hq/web-shared-componentspackage asDateSeparatorViewChanges
New shared component
DateSeparatorViewSnapshotinterfaceCodebase migration
DateSeparatorViewModel.tsxto element-web including unit-testCodebase migration
DateSeparatorViewinstead of the old component.Test plan
Tests
Before & After