File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/shared/containers/timeline-wall Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -77,9 +77,11 @@ function TimelineWallContainer(props) {
7777 } , [ pendingApprovals ] ) ;
7878
7979 useEffect ( ( ) => {
80- const target = document . getElementById ( `${ selectedFilterValue . year } -${ selectedFilterValue . month } ` ) ;
80+ const target = document . getElementById ( `${ selectedFilterValue . year } -${ ( selectedFilterValue . month + 1 ) . toString ( ) . padStart ( 2 , '0' ) } ` ) ;
8181 if ( target ) {
82- target . scrollIntoView ( { behavior : 'smooth' } , true ) ;
82+ const yOffset = - 10 ;
83+ const coordinate = target . getBoundingClientRect ( ) . top + window . pageYOffset + yOffset ;
84+ window . scrollTo ( { top : coordinate , behavior : 'smooth' } ) ;
8385 } else {
8486 window . scrollTo ( { top : 0 , behavior : 'smooth' } ) ;
8587 }
@@ -104,6 +106,8 @@ function TimelineWallContainer(props) {
104106 } ) ;
105107 } ;
106108
109+ const sortedEvents = _ . orderBy ( events , [ 'eventDate' ] , [ 'desc' ] ) ;
110+
107111 return (
108112 < div styleName = "container" >
109113 < div styleName = { isAdmin ? 'header header-admin' : 'header' } >
@@ -153,7 +157,7 @@ function TimelineWallContainer(props) {
153157 < TimelineEvents
154158 isAuthenticated = { ! ! authToken }
155159 isAdmin = { isAdmin }
156- events = { events }
160+ events = { sortedEvents }
157161 styleName = { cn ( 'tab-content' , { hide : tab === 1 , 'is-admin' : role === 'Admin user' } ) }
158162 removeEvent = { removeEvent }
159163 showRightFilterMobile = { showRightFilterMobile }
You can’t perform that action at this time.
0 commit comments