File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export const SelectFilter: FC<SelectFilterProps> = ({
52
52
< SelectMenuTrigger >
53
53
< SelectMenuButton
54
54
startIcon = { selectedOption ?. startIcon }
55
- css = { { width } }
55
+ css = { { width, flexGrow : 1 } }
56
56
aria-label = { label }
57
57
>
58
58
{ selectedOption ?. label ?? placeholder }
Original file line number Diff line number Diff line change @@ -142,6 +142,8 @@ type FilterProps = {
142
142
error ?: unknown ;
143
143
options ?: ReactNode ;
144
144
presets : PresetFilter [ ] ;
145
+ /** Set to true if there is not much horizontal space. */
146
+ compact ?: boolean ;
145
147
} ;
146
148
147
149
export const Filter : FC < FilterProps > = ( {
@@ -154,6 +156,7 @@ export const Filter: FC<FilterProps> = ({
154
156
learnMoreLabel2,
155
157
learnMoreLink2,
156
158
presets,
159
+ compact,
157
160
} ) => {
158
161
const theme = useTheme ( ) ;
159
162
// Storing local copy of the filter query so that it can be updated more
@@ -184,7 +187,10 @@ export const Filter: FC<FilterProps> = ({
184
187
display : "flex" ,
185
188
gap : 8 ,
186
189
marginBottom : 16 ,
187
- flexWrap : "nowrap" ,
190
+ // For now compact just means immediately wrapping, but maybe we should
191
+ // have a collapsible section or consolidate into one menu or something.
192
+ // TODO: Remove separate compact mode once multi-org is stable.
193
+ flexWrap : compact ? "wrap" : "nowrap" ,
188
194
189
195
[ theme . breakpoints . down ( "md" ) ] : {
190
196
flexWrap : "wrap" ,
Original file line number Diff line number Diff line change @@ -51,22 +51,23 @@ interface AuditFilterProps {
51
51
}
52
52
53
53
export const AuditFilter : FC < AuditFilterProps > = ( { filter, error, menus } ) => {
54
- // Use a smaller width if including the organization filter.
55
- const width = menus . organization && 175 ;
56
54
return (
57
55
< Filter
58
56
learnMoreLink = { docs ( "/admin/audit-logs#filtering-logs" ) }
59
57
presets = { PRESET_FILTERS }
60
58
isLoading = { menus . user . isInitializing }
61
59
filter = { filter }
62
60
error = { error }
61
+ // There is not much space with the sidebar and four filters, so in this
62
+ // case we will use the compact mode.
63
+ compact = { Boolean ( menus . organization ) }
63
64
options = {
64
65
< >
65
- < ResourceTypeMenu width = { width } menu = { menus . resourceType } />
66
- < ActionMenu width = { width } menu = { menus . action } />
67
- < UserMenu width = { width } menu = { menus . user } />
66
+ < ResourceTypeMenu menu = { menus . resourceType } />
67
+ < ActionMenu menu = { menus . action } />
68
+ < UserMenu menu = { menus . user } />
68
69
{ menus . organization && (
69
- < OrganizationsMenu width = { width } menu = { menus . organization } />
70
+ < OrganizationsMenu menu = { menus . organization } />
70
71
) }
71
72
</ >
72
73
}
You can’t perform that action at this time.
0 commit comments