Port upstream's result section headers (fixes #366)

This commit is contained in:
Thibaut Girka 2018-05-22 12:21:50 +02:00 committed by ThibG
parent 22bc07998c
commit d253449ff0
2 changed files with 40 additions and 0 deletions

View file

@ -68,6 +68,8 @@ export default function DrawerResults ({
</header> </header>
{accounts && accounts.size ? ( {accounts && accounts.size ? (
<section> <section>
<h5><FormattedMessage id='search_results.accounts' defaultMessage='People' /></h5>
{accounts.map( {accounts.map(
accountId => ( accountId => (
<AccountContainer <AccountContainer
@ -80,6 +82,8 @@ export default function DrawerResults ({
) : null} ) : null}
{statuses && statuses.size ? ( {statuses && statuses.size ? (
<section> <section>
<h5><FormattedMessage id='search_results.statuses' defaultMessage='Toots' /></h5>
{statuses.map( {statuses.map(
statusId => ( statusId => (
<StatusContainer <StatusContainer
@ -92,6 +96,8 @@ export default function DrawerResults ({
) : null} ) : null}
{hashtags && hashtags.size ? ( {hashtags && hashtags.size ? (
<section> <section>
<h5><FormattedMessage id='search_results.hashtags' defaultMessage='Hashtags' /></h5>
{hashtags.map( {hashtags.map(
hashtag => ( hashtag => (
<Link <Link

View file

@ -266,6 +266,40 @@
& > section { & > section {
background: $ui-base-color; background: $ui-base-color;
margin-bottom: 20px;
h5 {
position: relative;
&::before {
content: "";
display: block;
position: absolute;
left: 0;
right: 0;
top: 50%;
width: 100%;
height: 0;
border-top: 1px solid lighten($ui-base-color, 8%);
}
span {
display: inline-block;
background: $ui-base-color;
color: $darker-text-color;
font-size: 14px;
font-weight: 500;
padding: 10px;
position: relative;
z-index: 1;
cursor: default;
}
}
.account:last-child,
& > div:last-child .status {
border-bottom: 0;
}
& > .hashtag { & > .hashtag {
display: block; display: block;