Skip to content

Commit

Permalink
refactor: polished the log UI (#3591)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajat Dabade authored Sep 20, 2023
1 parent 3db8a25 commit 04acc49
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
20 changes: 20 additions & 0 deletions frontend/src/container/LogDetailedView/FieldRenderer.styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Tag } from 'antd';
import styled from 'styled-components';

export const TagContainer = styled(Tag)`
&&& {
border-radius: 0.25rem;
padding: 0.063rem 0.5rem;
font-weight: 600;
font-size: 0.75rem;
line-height: 1.25rem;
}
`;

export const TagLabel = styled.span`
font-weight: 400;
`;

export const TagValue = styled.span`
text-transform: capitalize;
`;
12 changes: 9 additions & 3 deletions frontend/src/container/LogDetailedView/FieldRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { blue } from '@ant-design/colors';
import { Tag } from 'antd';

import { TagContainer, TagLabel, TagValue } from './FieldRenderer.styles';
import { FieldRendererProps } from './LogDetailedView.types';
import { getFieldAttributes } from './utils';

Expand All @@ -12,8 +12,14 @@ function FieldRenderer({ field }: FieldRendererProps): JSX.Element {
{dataType && newField && logType ? (
<>
<span style={{ color: blue[4] }}>{newField} </span>
<Tag>Type: {logType}</Tag>
<Tag>Data type: {dataType}</Tag>
<TagContainer>
<TagLabel>Type: </TagLabel>
<TagValue>{logType}</TagValue>
</TagContainer>
<TagContainer>
<TagLabel>Data type: </TagLabel>
<TagValue>{dataType}</TagValue>
</TagContainer>
</>
) : (
<span style={{ color: blue[4] }}>{field}</span>
Expand Down

0 comments on commit 04acc49

Please sign in to comment.