Fixed: Links and already added icons overflowing on add artist/album search results

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
Qstick 2020-12-13 01:20:01 -05:00
parent 4d90daebf1
commit 960d738e29
4 changed files with 124 additions and 84 deletions

View File

@ -34,24 +34,37 @@
.content { .content {
flex: 0 1 100%; flex: 0 1 100%;
overflow: hidden;
} }
.name { .titleRow {
display: flex; display: flex;
}
.titleContainer {
display: flex;
align-items: flex-end;
flex: 0 1 auto;
}
.title {
font-weight: 300; font-weight: 300;
font-size: 36px; font-size: 36px;
} }
.artistName {
font-weight: 300;
font-size: 20px;
}
.year { .year {
margin-left: 10px; margin-left: 10px;
color: $disabledColor; color: $disabledColor;
} }
.icons {
display: flex;
align-items: center;
justify-content: space-between;
flex: 1 0 auto;
height: 55px;
}
.mbLink { .mbLink {
composes: link from '~Components/Link/Link.css'; composes: link from '~Components/Link/Link.css';
@ -75,3 +88,10 @@
margin-top: 20px; margin-top: 20px;
text-align: justify; text-align: justify;
} }
@media only screen and (max-width: $breakpointMedium) {
.titleRow {
justify-content: space-between;
overflow: hidden;
}
}

View File

@ -111,21 +111,26 @@ class AddNewAlbumSearchResult extends Component {
} }
<div className={styles.content}> <div className={styles.content}>
<div className={styles.name}> <div className={styles.titleRow}>
<div className={styles.titleContainer}>
<div className={styles.title}>
{title} {title}
{ {
!!disambiguation && !!disambiguation &&
<span className={styles.year}>({disambiguation})</span> <span className={styles.year}>({disambiguation})</span>
} }
</div>
</div>
<div className={styles.icons}>
{ {
isExistingAlbum ? isExistingAlbum ?
<Icon <Icon
className={styles.alreadyExistsIcon} className={styles.alreadyExistsIcon}
name={icons.CHECK_CIRCLE} name={icons.CHECK_CIRCLE}
size={20} size={36}
title="Album already in your library" title="Already in your library"
/> : /> :
null null
} }
@ -133,7 +138,7 @@ class AddNewAlbumSearchResult extends Component {
<Link <Link
className={styles.mbLink} className={styles.mbLink}
to={`https://musicbrainz.org/release-group/${foreignAlbumId}`} to={`https://musicbrainz.org/release-group/${foreignAlbumId}`}
onPress={this.onMBLinkPress} onPress={this.onTVDBLinkPress}
> >
<Icon <Icon
className={styles.mbLinkIcon} className={styles.mbLinkIcon}
@ -141,22 +146,7 @@ class AddNewAlbumSearchResult extends Component {
size={28} size={28}
/> />
</Link> </Link>
</div> </div>
<div>
<span className={styles.artistName}> By: {artist.artistName}</span>
{
isExistingArtist ?
<Icon
className={styles.alreadyExistsIcon}
name={icons.CHECK_CIRCLE}
size={15}
title="Artist already in your library"
/> :
null
}
</div> </div>
<div> <div>

View File

@ -34,10 +34,20 @@
.content { .content {
flex: 0 1 100%; flex: 0 1 100%;
overflow: hidden;
}
.nameRow {
display: flex;
}
.nameContainer {
display: flex;
align-items: flex-end;
flex: 0 1 auto;
} }
.name { .name {
display: flex;
font-weight: 300; font-weight: 300;
font-size: 36px; font-size: 36px;
} }
@ -47,6 +57,14 @@
color: $disabledColor; color: $disabledColor;
} }
.icons {
display: flex;
align-items: center;
justify-content: space-between;
flex: 1 0 auto;
height: 55px;
}
.mbLink { .mbLink {
composes: link from '~Components/Link/Link.css'; composes: link from '~Components/Link/Link.css';
@ -70,3 +88,10 @@
margin-top: 20px; margin-top: 20px;
text-align: justify; text-align: justify;
} }
@media only screen and (max-width: $breakpointMedium) {
.titleRow {
justify-content: space-between;
overflow: hidden;
}
}

View File

@ -111,22 +111,26 @@ class AddNewArtistSearchResult extends Component {
} }
<div className={styles.content}> <div className={styles.content}>
<div className={styles.nameRow}>
<div className={styles.nameContainer}>
<div className={styles.name}> <div className={styles.name}>
{artistName} {artistName}
{ {
!name.contains(year) && year ? !artistName.contains(year) && year ?
<span className={styles.year}> <span className={styles.year}>
({year}) ({year})
</span> : </span> :
null null
} }
{ {
!!disambiguation && !!disambiguation &&
<span className={styles.year}>({disambiguation})</span> <span className={styles.year}>({disambiguation})</span>
} }
</div>
</div>
<div className={styles.icons}>
{ {
isExistingArtist ? isExistingArtist ?
<Icon <Icon
@ -150,6 +154,7 @@ class AddNewArtistSearchResult extends Component {
/> />
</Link> </Link>
</div> </div>
</div>
<div> <div>
<Label size={sizes.LARGE}> <Label size={sizes.LARGE}>