File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,6 +173,12 @@ const Header = ({
173173 < CloseIcon title = "Clear Search Query" color = '#ffffff' size = '24px' onClick = { ( ) => setSearchTerm ( '' ) } />
174174 </ NavbarSearchInput >
175175 < DropdownButton variant = "outline-secondary" size = "sm" id = "dropdown-basic-button" title = { `Sort by ${ sort } ` } className = "border-0" >
176+ < Dropdown . Item
177+ href = "#"
178+ active = { sort === 'oldest' }
179+ onClick = { ( ) => setSort ( 'oldest' ) } >
180+ Oldest
181+ </ Dropdown . Item >
176182 < Dropdown . Item
177183 href = "#"
178184 active = { sort === 'popularity' }
Original file line number Diff line number Diff line change @@ -221,6 +221,8 @@ const ShapeList = (
221221 copy . sort ( ( a , b ) => b . __createdtime__ - a . __createdtime__ ) ;
222222 } else if ( sort === 'popularity' ) {
223223 copy . sort ( ( a , b ) => b . likes - a . likes ) ;
224+ } else if ( sort === 'oldest' ) {
225+ copy . sort ( ( a , b ) => a . __createdtime__ - b . __createdtime__ ) ;
224226 }
225227 setFilteredShape ( filterShape ( copy , searchTerm ) ) ;
226228 } , [ searchTerm , shapes , sort ] ) ;
You can’t perform that action at this time.
0 commit comments