Skip to content

Commit

Permalink
use button
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnagara committed Jun 4, 2019
1 parent 1a87b00 commit 165214d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/sentry/static/sentry/app/views/organizationEventsV2/data.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ProjectBadge from 'app/components/idBadge/projectBadge';
import UserBadge from 'app/components/idBadge/userBadge';
import DateTime from 'app/components/dateTime';

import {QueryLink} from './styles';
import {QueryButton} from './styles';

export const ALL_VIEWS = deepFreeze([
{
Expand Down Expand Up @@ -82,9 +82,9 @@ export const SPECIAL_FIELDS = {
type: {
fields: ['event.type'],
renderFunc: (data, {onSearch}) => (
<QueryLink onClick={() => onSearch(`event.type:${data['event.type']}`)}>
<QueryButton onClick={() => onSearch(`event.type:${data['event.type']}`)}>
{data['event.type']}
</QueryLink>
</QueryButton>
),
},
project: {
Expand Down Expand Up @@ -117,7 +117,9 @@ export const SPECIAL_FIELDS = {
return <Container>{badge}</Container>;
}

return <QueryLink onClick={() => onSearch(`user:${data.user}`)}>{badge}</QueryLink>;
return (
<QueryButton onClick={() => onSearch(`user:${data.user}`)}>{badge}</QueryButton>
);
},
},
time: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import React from 'react';
import styled from 'react-emotion';
import space from 'app/styles/space';
import Button from 'app/components/button';
import overflowEllipsis from 'app/styles/overflowEllipsis';

export const QueryLink = styled('a')`
export const QueryButton = styled(props => (
<Button size="zero" borderless={true} {...props} />
))`
${overflowEllipsis};
color: ${p => p.theme.foreground};
padding: ${space(1)};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {t} from 'app/locale';
import space from 'app/styles/space';

import {SPECIAL_FIELDS} from './data';
import {QueryLink} from './styles';
import {QueryButton} from './styles';

export default class Table extends React.Component {
static propTypes = {
Expand Down Expand Up @@ -45,9 +45,9 @@ export default class Table extends React.Component {
{SPECIAL_FIELDS.hasOwnProperty(field) ? (
SPECIAL_FIELDS[field].renderFunc(row, {organization, onSearch, location})
) : (
<QueryLink onClick={() => onSearch(`${field}:${row[field]}`)}>
<QueryButton onClick={() => onSearch(`${field}:${row[field]}`)}>
{row[field]}
</QueryLink>
</QueryButton>
)}
</Cell>
))}
Expand Down

0 comments on commit 165214d

Please sign in to comment.