Skip to content

Commit

Permalink
updates for sync badge
Browse files Browse the repository at this point in the history
  • Loading branch information
brittanyjoiner15 committed Jan 27, 2020
1 parent 124269b commit e1d2d0f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,37 @@ import { storiesOf } from '@storybook/react';
import React from 'react';
import { SyncBadge } from './SyncBadge';

storiesOf('app/TransactionDetails/SyncBadge', module).add(
'sync=true',
() => {
return (
<SyncBadge sync={true}/>
);
},
{
info: {
source: false
storiesOf('app/TransactionDetails/SyncBadge', module)
.add(
'sync=true',
() => {
return <SyncBadge sync={true} />;
},
{
info: {
source: false
}
}
}
).add(
)
.add(
'sync=false',
() => {
return (
<SyncBadge sync={false}/>
);
},
{
info: {
source: false
() => {
return <SyncBadge sync={false} />;
},
{
info: {
source: false
}
}
}
).add(
)
.add(
'sync=undefined',
() => {
return (
<SyncBadge/>
);
},
{
info: {
source: false
() => {
return <SyncBadge />;
},
{
info: {
source: false
}
}
}
)
);
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { EuiBadge } from '@elastic/eui';
import React from 'react';
import styled from 'styled-components';
import { px, units } from '../../../../../../style/variables';
import { i18n } from '@kbn/i18n';

const SpanBadge = styled(EuiBadge)`
display: inline-block;
Expand All @@ -21,9 +22,16 @@ interface SyncBadgeProps {
export function SyncBadge({ sync }: SyncBadgeProps) {
switch (sync) {
case true:
return <SpanBadge>{'blocking'}</SpanBadge>;
return (
<SpanBadge>
{i18n.translate('xpack.apm.transactionDetails.syncBadgeBlocking', {
defaultMessage: 'blocking'
})}
blocking
</SpanBadge>
);
case false:
return <SpanBadge>{'async'}</SpanBadge>;
return <SpanBadge>async</SpanBadge>;
default:
return null;
}
Expand Down

0 comments on commit e1d2d0f

Please sign in to comment.