Skip to content

Commit c56d4e2

Browse files
committed
fix(ui): Consistently use min-width media queries
Because we were using a mix of `max-width` and `min-width` media queries at the specific pixel size of the query one would apply but not the other, in some cases causing the layout to completely break.
1 parent 9ed4ed8 commit c56d4e2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

static/app/views/issueList/actions/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ function IssueListActions({
178178
);
179179
const theme = useTheme();
180180

181-
const disableActions = useMedia(
182-
`(max-width: ${isSavedSearchesOpen ? theme.breakpoints.xl : theme.breakpoints.md})`
181+
const disableActions = !useMedia(
182+
`(min-width: ${isSavedSearchesOpen ? theme.breakpoints.xl : theme.breakpoints.md})`
183183
);
184184

185185
const numIssues = selectedIdsSet.size;

static/app/views/issueList/groupListBody.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ function GroupList({
100100
false
101101
);
102102
const topIssue = groupIds[0];
103-
const canSelect = !useMedia(
104-
`(max-width: ${isSavedSearchesOpen ? theme.breakpoints.xl : theme.breakpoints.md})`
103+
const canSelect = useMedia(
104+
`(min-width: ${isSavedSearchesOpen ? theme.breakpoints.xl : theme.breakpoints.md})`
105105
);
106106

107107
const columns: GroupListColumn[] = [

static/app/views/nav/context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function NavContextProvider({children}: {children: React.ReactNode}) {
5656
useState<PrimaryNavGroup | null>(null);
5757

5858
const theme = useTheme();
59-
const isMobile = useMedia(`(max-width: ${theme.breakpoints.md})`);
59+
const isMobile = !useMedia(`(min-width: ${theme.breakpoints.md})`);
6060

6161
const startInteraction = useCallback(() => {
6262
isInteractingRef.current = true;

0 commit comments

Comments
 (0)