Skip to content

Commit

Permalink
[Fix, Refactor] SessionDetail - Width 값 계산 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
insub4067 committed Oct 3, 2023
1 parent f2d27fe commit 188f56c
Showing 1 changed file with 39 additions and 20 deletions.
59 changes: 39 additions & 20 deletions AsyncSwift/Views/SessionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,40 @@ struct SessionView: View {
let speakerImageSize: CGFloat = 80

var body: some View {
ZStack {
ScrollView {
Group {
customDivider
.padding(.top, 10)
.padding(.bottom, 4)
sessionDetail
}
.background(.white)
speakerDetail
ScrollView {
Group {
customDivider
.padding(.top, 10)
.padding(.bottom, 4)
sessionDetail
}
.navigationTitle("Session")
.background(.white)
speakerDetail
}
.navigationTitle("Session")
}
}

private extension SessionView {

var sessionDetail: some View {
HStack(spacing: 0) {
VStack(alignment: .leading, spacing: 0) {
VStack(alignment: .leading, spacing: 0) {
HStack {
Text(session.title)
.font(.title3)
.fontWeight(.semibold)
.padding(.vertical, 24)
VStack(alignment: .leading, spacing: 8) {
ForEach(session.description, id: \.self) { paragraph in
Text(paragraph.content)
}
Spacer(minLength: 0)
}
.background(Color.white)
VStack(alignment: .leading, spacing: 8) {
ForEach(session.description, id: \.self) { paragraph in
Text(paragraph.content)
}
.padding(.bottom, 80)
}
.padding(.horizontal, 24)
Spacer()
.padding(.bottom, 80)
}
.frame(width: UIScreen.main.bounds.width - 32)
}

var speakerDetail: some View {
Expand Down Expand Up @@ -87,3 +86,23 @@ private extension SessionView {
.background(Color.speakerBackground)
}
}

struct SessionView_Previews: PreviewProvider {
static var previews: some View {
SessionView(
session: .init(
id: 0,
title: "[Event] 사이드 프로젝트가 메인 JOB이 되기까지의 이야기",
description: [
.init(content: "사이드 프로젝트가 메인 JOB이 되기까지 이야기")
],
speaker: .init(
name: "박성은",
imageURL: "",
role: "북적 스튜디오 | iOS Developer",
description: "iOS 개발자 입니다."
)
)
)
}
}

0 comments on commit 188f56c

Please sign in to comment.