feat(creator): 타이틀 바 닉네임을 표시한다
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import SwiftUI
|
||||
|
||||
struct CreatorChannelTitleBar: View {
|
||||
let nickname: String
|
||||
let isFollow: Bool
|
||||
let isNotify: Bool
|
||||
let backgroundProgress: CGFloat
|
||||
@@ -20,11 +21,13 @@ struct CreatorChannelTitleBar: View {
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
|
||||
Text("")
|
||||
Text(nickname)
|
||||
.appFont(.heading2)
|
||||
|
||||
|
||||
Spacer(minLength: 0)
|
||||
.foregroundColor(Color.white)
|
||||
.lineLimit(1)
|
||||
.truncationMode(.tail)
|
||||
.opacity(backgroundProgress >= 1 ? 1 : 0)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
|
||||
HStack(spacing: SodaSpacing.s14) {
|
||||
followButton
|
||||
@@ -40,6 +43,7 @@ struct CreatorChannelTitleBar: View {
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
.layoutPriority(1)
|
||||
}
|
||||
.padding(.horizontal, SodaSpacing.s14)
|
||||
.frame(height: 56)
|
||||
@@ -85,9 +89,10 @@ struct CreatorChannelTitleBar_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
VStack(spacing: SodaSpacing.s16) {
|
||||
CreatorChannelTitleBar(
|
||||
nickname: "Soda Creator Long Nickname Soda Creator Long Nickname",
|
||||
isFollow: false,
|
||||
isNotify: false,
|
||||
backgroundProgress: 0,
|
||||
backgroundProgress: 1,
|
||||
onTapBack: {},
|
||||
onTapFollow: {},
|
||||
onTapUnfollow: {},
|
||||
@@ -97,9 +102,10 @@ struct CreatorChannelTitleBar_Previews: PreviewProvider {
|
||||
)
|
||||
|
||||
CreatorChannelTitleBar(
|
||||
nickname: "Soda Creator",
|
||||
isFollow: true,
|
||||
isNotify: true,
|
||||
backgroundProgress: 0,
|
||||
backgroundProgress: 1,
|
||||
onTapBack: {},
|
||||
onTapFollow: {},
|
||||
onTapUnfollow: {},
|
||||
@@ -109,9 +115,10 @@ struct CreatorChannelTitleBar_Previews: PreviewProvider {
|
||||
)
|
||||
|
||||
CreatorChannelTitleBar(
|
||||
nickname: "Soda Creator",
|
||||
isFollow: true,
|
||||
isNotify: false,
|
||||
backgroundProgress: 0,
|
||||
backgroundProgress: 1,
|
||||
onTapBack: {},
|
||||
onTapFollow: {},
|
||||
onTapUnfollow: {},
|
||||
|
||||
@@ -78,6 +78,7 @@ struct CreatorChannelView: View {
|
||||
|
||||
private func titleBar(backgroundProgress: CGFloat) -> some View {
|
||||
CreatorChannelTitleBar(
|
||||
nickname: viewModel.response?.creator.nickname ?? "",
|
||||
isFollow: viewModel.response?.creator.isFollow ?? false,
|
||||
isNotify: viewModel.response?.creator.isNotify ?? false,
|
||||
backgroundProgress: backgroundProgress,
|
||||
|
||||
Reference in New Issue
Block a user