Skip to content

Commit 1423553

Browse files
authored
integrations: use design sytem tag component (#87712)
Use the builtin tag component.
1 parent 42efa2a commit 1423553

File tree

1 file changed

+17
-35
lines changed

1 file changed

+17
-35
lines changed

static/app/views/settings/organizationIntegrations/integrationRow.tsx

Lines changed: 17 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import styled from '@emotion/styled';
22
import startCase from 'lodash/startCase';
33

44
import {Alert} from 'sentry/components/core/alert';
5+
import {Tag} from 'sentry/components/core/badge/tag';
56
import {LinkButton} from 'sentry/components/core/button';
67
import Link from 'sentry/components/links/link';
78
import PanelItem from 'sentry/components/panels/panelItem';
@@ -109,11 +110,12 @@ function IntegrationRow(props: Props) {
109110
</TitleContainer>
110111
<TagsContainer>
111112
{categories?.map(category => (
112-
<CategoryTag
113+
<Tag
113114
key={category}
114-
category={category === 'api' ? 'API' : startCase(category)}
115-
priority={category === publishStatus}
116-
/>
115+
type={category === publishStatus ? 'highlight' : 'default'}
116+
>
117+
{category === 'api' ? 'API' : startCase(category)}
118+
</Tag>
117119
))}
118120
</TagsContainer>
119121
</FlexContainer>
@@ -176,8 +178,12 @@ const TitleContainer = styled('div')`
176178

177179
const TagsContainer = styled('div')`
178180
flex: 3;
179-
text-align: right;
180181
padding: 0 ${space(2)};
182+
display: flex;
183+
flex-direction: row;
184+
flex-wrap: wrap;
185+
gap: ${space(1)};
186+
justify-content: flex-end;
181187
`;
182188

183189
const IntegrationName = styled(Link)`
@@ -191,59 +197,35 @@ const IntegrationDetails = styled('div')`
191197
`;
192198

193199
const StyledLink = styled(Link)`
194-
color: ${p => p.theme.gray300};
200+
color: ${p => p.theme.subText};
195201
&:before {
196202
content: '|';
197-
color: ${p => p.theme.gray200};
203+
color: ${p => p.theme.subText};
198204
margin-right: ${space(0.75)};
199205
}
200206
`;
201207

202208
const LearnMore = styled(Link)`
203-
color: ${p => p.theme.gray300};
209+
color: ${p => p.theme.subText};
204210
`;
205211

206-
type PublishStatusProps = {status: SentryApp['status']; theme?: any};
212+
type PublishStatusProps = {status: SentryApp['status']};
207213

208214
const PublishStatus = styled(({status, ...props}: PublishStatusProps) => (
209215
<div {...props}>{status}</div>
210216
))`
211-
color: ${(props: PublishStatusProps) =>
212-
props.status === 'published' ? props.theme.success : props.theme.gray300};
217+
color: ${p => (p.status === 'published' ? p.theme.success : p.theme.gray300)};
213218
font-weight: light;
214219
margin-right: ${space(0.75)};
215220
text-transform: capitalize;
216221
&:before {
217222
content: '|';
218-
color: ${p => p.theme.gray200};
223+
color: ${p => p.theme.subText};
219224
margin-right: ${space(0.75)};
220225
font-weight: ${p => p.theme.fontWeightNormal};
221226
}
222227
`;
223228

224-
// TODO(Priscila): Replace this component with the Tag component
225-
const CategoryTag = styled(
226-
({
227-
priority: _priority,
228-
category,
229-
...p
230-
}: {
231-
category: string;
232-
priority: boolean;
233-
theme?: any;
234-
}) => <div {...p}>{category}</div>
235-
)`
236-
display: inline-block;
237-
padding: 1px 10px;
238-
background: ${p => (p.priority ? p.theme.purple200 : p.theme.gray100)};
239-
border-radius: 20px;
240-
font-size: ${space(1.5)};
241-
margin: ${space(0.25)} ${space(0.5)};
242-
line-height: ${space(3)};
243-
text-align: center;
244-
color: ${p => (p.priority ? p.theme.white : p.theme.gray500)};
245-
`;
246-
247229
const ResolveNowButton = styled(LinkButton)`
248230
color: ${p => p.theme.subText};
249231
float: right;

0 commit comments

Comments
 (0)