Skip to content

Commit 3be52a9

Browse files
authored
button: remove redundant button label styles (#89996)
Nowrap is already applied to ButtonLabel by its styling, and font-weight shouldn't require targeting via ButtonLabel as the original styles do not apply it
1 parent dc9bf43 commit 3be52a9

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

static/app/components/dropdownButton.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import {css} from '@emotion/react';
12
import styled from '@emotion/styled';
23

34
import type {ButtonProps} from 'sentry/components/core/button';
4-
import {Button, ButtonLabel} from 'sentry/components/core/button';
5+
import {Button} from 'sentry/components/core/button';
56
import {IconChevron} from 'sentry/icons';
67
import {space} from 'sentry/styles/space';
78

@@ -78,8 +79,16 @@ const StyledButton = styled(Button)<StyledButtonProps>`
7879
max-width: 100%;
7980
z-index: 2;
8081
81-
${p => (p.isOpen || p.disabled) && 'box-shadow: none;'}
82-
${p => p.hasPrefix && `${ButtonLabel} {font-weight: ${p.theme.fontWeightNormal};}`}
82+
${p =>
83+
(p.isOpen || p.disabled) &&
84+
css`
85+
box-shadow: none;
86+
`}
87+
${p =>
88+
p.hasPrefix &&
89+
css`
90+
font-weight: ${p.theme.fontWeightNormal};
91+
`}
8392
`;
8493

8594
const LabelText = styled('span')`

static/gsApp/components/features/disabledRelay.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from '@emotion/styled';
22

3-
import {Button, ButtonLabel} from 'sentry/components/core/button';
3+
import {Button} from 'sentry/components/core/button';
44
import EmptyMessage from 'sentry/components/emptyMessage';
55
import Panel from 'sentry/components/panels/panel';
66
import {IconBroadcast, IconBusiness} from 'sentry/icons';
@@ -71,9 +71,6 @@ const ButtonBar = styled('div')`
7171
justify-content: center;
7272
align-items: center;
7373
margin: -${space(0.75)};
74-
${ButtonLabel} {
75-
white-space: nowrap;
76-
}
7774
`;
7875

7976
const StyledButton = styled(Button)`

static/gsApp/hooks/disabledCustomSymbolSources.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from '@emotion/styled';
22

3-
import {Button, ButtonLabel} from 'sentry/components/core/button';
3+
import {Button} from 'sentry/components/core/button';
44
import {ButtonBar} from 'sentry/components/core/button/buttonBar';
55
import EmptyMessage from 'sentry/components/emptyMessage';
66
import {IconBusiness, IconLock} from 'sentry/icons';
@@ -78,9 +78,7 @@ const Content = styled(EmptyMessage)`
7878

7979
const StyledButton = styled(Button)`
8080
margin: ${space(0.75)};
81-
${ButtonLabel} {
82-
white-space: nowrap;
83-
}
81+
white-space: nowrap;
8482
`;
8583

8684
const StyledLearnMoreButton = styled(LearnMoreButton)`

0 commit comments

Comments
 (0)