Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
style(ResultContainer.module.scss): change border radius of key and v…
Browse files Browse the repository at this point in the history
…alue classes

feat(ResultContainer.tsx): replace key-value pairs with badges in RepoMetadata component
  • Loading branch information
erzhtor committed Apr 13, 2023
1 parent 590452b commit a60c085
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,12 @@
font-size: 0.75rem;

&-key {
padding: 0.075rem 0.2rem 0.075rem 0.375rem;
border-radius: 3px 0 0 3px;
color: var(--body-bg);
background-color: var(--text-muted);
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}

&-value {
font-size: 0.75rem;
padding: 0.075rem 0.375rem 0.075rem 0.2rem;
border-radius: 0 3px 3px 0;
color: var(--body-color);
background-color: var(--secondary);
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
10 changes: 7 additions & 3 deletions client/branded/src/search-ui/components/ResultContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react'
import classNames from 'classnames'

import { SearchMatch } from '@sourcegraph/shared/src/search/stream'
import { ForwardReferenceExoticComponent } from '@sourcegraph/wildcard'
import { Badge, ForwardReferenceExoticComponent } from '@sourcegraph/wildcard'

import { formatRepositoryStarCount } from '../util/stars'

Expand Down Expand Up @@ -47,8 +47,12 @@ const RepoMetadata: React.FunctionComponent<{ keyValuePairs?: Record<string, str
<div className={classNames(styles.repoMetadata, className, 'd-flex align-items-center flex-wrap')}>
{Object.entries(keyValuePairs).map(([key, value]) => (
<span className="d-flex align-items-center justify-content-center" key={`${key}:${value}`}>
<span className={styles.repoMetadataKey}>{key}</span>
<span className={styles.repoMetadataValue}>{value}</span>
<Badge variant="info" className={styles.repoMetadataKey}>
{key}
</Badge>
<Badge variant="secondary" className={styles.repoMetadataValue}>
{value}
</Badge>
</span>
))}
</div>
Expand Down

0 comments on commit a60c085

Please sign in to comment.