@@ -15,6 +15,7 @@ import {
15
15
Drawer ,
16
16
Checkbox ,
17
17
VisuallyHidden ,
18
+ Stack ,
18
19
} from "ol-components"
19
20
20
21
import {
@@ -60,8 +61,6 @@ const StyledResourceTabs = styled(ResourceCategoryTabs.TabList)`
60
61
`
61
62
62
63
const DesktopSortContainer = styled . div `
63
- float: right;
64
-
65
64
${ ( { theme } ) => theme . breakpoints . down ( "md" ) } {
66
65
display: none;
67
66
}
@@ -439,10 +438,17 @@ const MobileFacetsTitleContainer = styled.div`
439
438
}
440
439
`
441
440
442
- const StyledGridContainer = styled ( GridContainer ) `
441
+ const ReversedGridContainer = styled ( GridContainer ) `
443
442
max-width: 1272px !important;
444
443
margin-left: 0 !important;
445
444
width: 100% !important;
445
+
446
+ /**
447
+ We want the facets to be visually on left, but occur second in the DOM / tab
448
+ order. This makes it easier for keyboard navigators to get directly to the
449
+ search results.
450
+ */
451
+ flex-direction: row-reverse;
446
452
`
447
453
448
454
const ExplanationContainer = styled . div `
@@ -860,33 +866,8 @@ const SearchDisplay: React.FC<SearchDisplayProps> = ({
860
866
861
867
return (
862
868
< Container >
863
- < StyledGridContainer >
869
+ < ReversedGridContainer >
864
870
< ResourceCategoryTabs . Context activeTabName = { activeTab . name } >
865
- < DesktopFiltersColumn
866
- component = "section"
867
- variant = "sidebar-2"
868
- data-testid = "facets-container"
869
- >
870
- < FacetsTitleContainer >
871
- < FilterTitle >
872
- < Typography component = { filterHeadingEl } variant = "subtitle1" >
873
- Filter
874
- </ Typography >
875
- < RiEqualizerLine fontSize = "medium" />
876
- </ FilterTitle >
877
- { hasFacets ? (
878
- < Button
879
- variant = "text"
880
- color = "secondary"
881
- size = "small"
882
- onClick = { clearAllFacets }
883
- >
884
- Clear all
885
- </ Button >
886
- ) : null }
887
- </ FacetsTitleContainer >
888
- { filterContents }
889
- </ DesktopFiltersColumn >
890
871
< StyledMainColumn component = "section" variant = "main-2" >
891
872
< VisuallyHidden as = { resultsHeadingEl } >
892
873
Search Results
@@ -901,13 +882,15 @@ const SearchDisplay: React.FC<SearchDisplayProps> = ({
901
882
*/ }
902
883
{ isFetching || isLoading ? "" : `${ data ?. count } results` }
903
884
</ VisuallyHidden >
904
- < DesktopSortContainer > { sortDropdown } </ DesktopSortContainer >
905
- < StyledResourceTabs
906
- setSearchParams = { setSearchParams }
907
- tabs = { TABS }
908
- aggregations = { data ?. metadata . aggregations }
909
- onTabChange = { ( ) => setPage ( 1 ) }
910
- />
885
+ < Stack direction = "row" justifyContent = "space-between" >
886
+ < StyledResourceTabs
887
+ setSearchParams = { setSearchParams }
888
+ tabs = { TABS }
889
+ aggregations = { data ?. metadata . aggregations }
890
+ onTabChange = { ( ) => setPage ( 1 ) }
891
+ />
892
+ < DesktopSortContainer > { sortDropdown } </ DesktopSortContainer >
893
+ </ Stack >
911
894
< ResourceCategoryTabs . TabPanels tabs = { TABS } >
912
895
< MobileFilter >
913
896
< Button variant = "text" onClick = { toggleMobileDrawer ( true ) } >
@@ -1011,8 +994,33 @@ const SearchDisplay: React.FC<SearchDisplayProps> = ({
1011
994
</ PaginationContainer >
1012
995
</ ResourceCategoryTabs . TabPanels >
1013
996
</ StyledMainColumn >
997
+ < DesktopFiltersColumn
998
+ component = "section"
999
+ variant = "sidebar-2"
1000
+ data-testid = "facets-container"
1001
+ >
1002
+ < FacetsTitleContainer >
1003
+ < FilterTitle >
1004
+ < Typography component = { filterHeadingEl } variant = "subtitle1" >
1005
+ Filter
1006
+ </ Typography >
1007
+ < RiEqualizerLine fontSize = "medium" />
1008
+ </ FilterTitle >
1009
+ { hasFacets ? (
1010
+ < Button
1011
+ variant = "text"
1012
+ color = "secondary"
1013
+ size = "small"
1014
+ onClick = { clearAllFacets }
1015
+ >
1016
+ Clear all
1017
+ </ Button >
1018
+ ) : null }
1019
+ </ FacetsTitleContainer >
1020
+ { filterContents }
1021
+ </ DesktopFiltersColumn >
1014
1022
</ ResourceCategoryTabs . Context >
1015
- </ StyledGridContainer >
1023
+ </ ReversedGridContainer >
1016
1024
</ Container >
1017
1025
)
1018
1026
}
0 commit comments