Skip to content

Commit

Permalink
feat(artist): add bio view
Browse files Browse the repository at this point in the history
  • Loading branch information
angristan committed Jul 25, 2021
1 parent c160a5a commit 2046f28
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
4 changes: 4 additions & 0 deletions firstfm.xcodeproj/project.pbxproj
Expand Up @@ -31,6 +31,7 @@
822E9A9226A9795200C5307B /* TagInfoResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 822E9A9126A9795200C5307B /* TagInfoResponse.swift */; };
822E9A9426A97B3600C5307B /* TagTopArtistsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 822E9A9326A97B3600C5307B /* TagTopArtistsResponse.swift */; };
822E9A9626A97B7200C5307B /* TagViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 822E9A9526A97B7200C5307B /* TagViewModel.swift */; };
8240989C26ADF67F00A789D9 /* ArtistBioView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8240989B26ADF67E00A789D9 /* ArtistBioView.swift */; };
82505CDF2675074E00CCCB58 /* ArtistRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82505CDC2675074E00CCCB58 /* ArtistRow.swift */; };
82505CE02675074E00CCCB58 /* ChartListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82505CDD2675074E00CCCB58 /* ChartListView.swift */; };
82505CE12675074E00CCCB58 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82505CDE2675074E00CCCB58 /* ContentView.swift */; };
Expand Down Expand Up @@ -123,6 +124,7 @@
822E9A9126A9795200C5307B /* TagInfoResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagInfoResponse.swift; sourceTree = "<group>"; };
822E9A9326A97B3600C5307B /* TagTopArtistsResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagTopArtistsResponse.swift; sourceTree = "<group>"; };
822E9A9526A97B7200C5307B /* TagViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagViewModel.swift; sourceTree = "<group>"; };
8240989B26ADF67E00A789D9 /* ArtistBioView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtistBioView.swift; sourceTree = "<group>"; };
82505CDC2675074E00CCCB58 /* ArtistRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArtistRow.swift; sourceTree = "<group>"; };
82505CDD2675074E00CCCB58 /* ChartListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChartListView.swift; sourceTree = "<group>"; };
82505CDE2675074E00CCCB58 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -368,6 +370,7 @@
825F0FBE26A6F4D0007BA84B /* TintOverlayView.swift */,
825F0FC426A74539007BA84B /* TopArtistAlbumsView.swift */,
825F0FC226A721F7007BA84B /* TopArtistTracksView.swift */,
8240989B26ADF67E00A789D9 /* ArtistBioView.swift */,
);
path = Artist;
sourceTree = "<group>";
Expand Down Expand Up @@ -594,6 +597,7 @@
82A006B6267960710009BD71 /* TrackRowView.swift in Sources */,
82A006B8267960D90009BD71 /* Track.swift in Sources */,
825F0FA026A5EC82007BA84B /* Session.swift in Sources */,
8240989C26ADF67F00A789D9 /* ArtistBioView.swift in Sources */,
822E9A9026A9788900C5307B /* TagView.swift in Sources */,
82B6CCE526AB80B4008AFDEF /* TopUserArtistsView.swift in Sources */,
82505CE72675300400CCCB58 /* SpotifyArtistSearchResponse.swift in Sources */,
Expand Down
33 changes: 33 additions & 0 deletions firstfm/Views/Artist/ArtistBioView.swift
@@ -0,0 +1,33 @@
//
// ArtistBioView.swift
// firstfm
//
// Created by Stanislas Lange on 25/07/2021.
//

import SwiftUI

struct ArtistBioView: View {
var artistInfo: ArtistInfo?

var body: some View {
ScrollView {
VStack(alignment: .leading) {
Text(artistInfo?.bio.content ?? "There is no bio for this artist")
.padding()
.navigationTitle("\(artistInfo?.name ?? "Artist") bio")
.navigationBarItems(trailing: HStack {
if let link = artistInfo?.bio.links.link.href {

Link(destination: URL(string: link)!) {
Image(systemName: "link.circle.fill")
.imageScale(.large)
.foregroundColor(.white)
}
}
})

}
}
}
}
10 changes: 9 additions & 1 deletion firstfm/Views/Artist/ArtistInfoView.swift
Expand Up @@ -14,7 +14,15 @@ struct ArtistInfoView: View {
.font(.subheadline)
.foregroundColor(.gray)
}
Text(artistInfo?.bio.content ?? "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.").lineLimit(3)

NavigationLink(destination: ArtistBioView(artistInfo: artistInfo)) {
VStack(alignment: .leading) {
Text(artistInfo?.bio.content ?? "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.")
.lineLimit(3)
.multilineTextAlignment(.leading)
.foregroundColor(.white)
}
}

ScrollView(.horizontal, showsIndicators: false) {
HStack {
Expand Down

0 comments on commit 2046f28

Please sign in to comment.