-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from School-of-Company/72-Program-Detail-Publi…
…shing 🔀 :: [#77] 프로그램 자세히보기 퍼블리싱
- Loading branch information
Showing
2 changed files
with
208 additions
and
0 deletions.
There are no files selected for viewing
87 changes: 87 additions & 0 deletions
87
Projects/App/Sources/DesignSystem/Program/ExpoProgramDetail.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// | ||
// ExpoProgramDetail.swift | ||
// Expo-iOS | ||
// | ||
// Created by 서지완 on 12/26/24. | ||
// Copyright © 2024 SchoolofCompany. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public struct ExpoProgramDetail: View { | ||
var programNum: Int | ||
var userName: String | ||
var affiliation: String | ||
var position: String | ||
var attendanceState: Bool | ||
var inTime: String | ||
var action: () -> Void | ||
|
||
@State private var isPressed = false | ||
|
||
public init( | ||
programNum: Int, | ||
userName: String, | ||
affiliation: String, | ||
position: String, | ||
attendanceState: Bool, | ||
inTime: String, | ||
action: @escaping () -> Void = {} | ||
) { | ||
self.programNum = programNum | ||
self.userName = userName | ||
self.affiliation = affiliation | ||
self.position = position | ||
self.attendanceState = attendanceState | ||
self.inTime = inTime | ||
self.action = action | ||
} | ||
|
||
public var body: some View { | ||
Button(action: { | ||
self.action() | ||
}) { | ||
HStack(spacing: 0) { | ||
Text("\(programNum)") | ||
.expoFont(.caption1B) | ||
.padding(.leading, 8) | ||
|
||
Text(userName) | ||
.padding(.leading, 38) | ||
|
||
Text(affiliation) | ||
.padding(.leading, 30) | ||
|
||
Text(position) | ||
.padding(.leading, 20) | ||
|
||
if attendanceState { | ||
Text("출석") | ||
.padding(.leading, 48) | ||
} else { | ||
Text("미출석") | ||
.padding(.leading, 48) | ||
} | ||
|
||
Text(inTime) | ||
.padding(.leading, 48) | ||
|
||
} | ||
.padding(.bottom, 36) | ||
.expoFont(.caption2R) | ||
} | ||
.buttonStyle(PlainButtonStyle()) | ||
.gesture( | ||
DragGesture(minimumDistance: 0) | ||
.onChanged { _ in self.isPressed = true } | ||
.onEnded { _ in | ||
self.isPressed = false | ||
self.action() | ||
} | ||
) | ||
} | ||
} | ||
|
||
#Preview { | ||
ProgramDetailView() | ||
} |
121 changes: 121 additions & 0 deletions
121
Projects/App/Sources/Feature/ProgramDetailFeature/Sources/ProgramDetailView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
// | ||
// ProgramDetailView.swift | ||
// Expo-iOS | ||
// | ||
// Created by 서지완 on 12/26/24. | ||
// Copyright © 2024 SchoolofCompany. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ProgramDetailView: View { | ||
@Environment(\.dismiss) var dismiss | ||
|
||
var body: some View { | ||
ZStack { | ||
HStack(spacing: 0) { | ||
Button { | ||
dismiss() | ||
} label: { | ||
ExpoIOSAsset.Assets.leftBackButton.swiftUIImage | ||
.padding(.leading, 4) | ||
} | ||
|
||
Spacer() | ||
} | ||
|
||
Text("프로그램") | ||
.expoFont(.body1R) | ||
} | ||
|
||
VStack(alignment: .leading, spacing: 0) { | ||
HStack(spacing: 0) { | ||
Text("프로그램") | ||
.expoFont(.body2B) | ||
|
||
Spacer() | ||
|
||
ExpoButton( | ||
text: "QR 스캔", | ||
horizontalPadding: 12, | ||
verticalPadding: 8, | ||
backColor: ExpoColor.main.swiftUIColor, | ||
actionColor: ExpoColor.main300.swiftUIColor | ||
) | ||
} | ||
.padding(.horizontal, 16) | ||
|
||
HStack(spacing: 10) { | ||
ExpoIOSAsset.Assets.warning.swiftUIImage | ||
.padding(.leading, 16) | ||
|
||
Text("옆으로 넘겨서 확인해보세요") | ||
.expoFont(.caption2R) | ||
.expoColor(ExpoColor.gray300) | ||
|
||
Spacer() | ||
|
||
Rectangle() | ||
.frame(width: 1, height: 14) | ||
.expoColor(ExpoColor.gray100) | ||
.padding(.trailing, 14) | ||
|
||
Text("참가자 전체 인원") | ||
.expoColor(ExpoColor.gray500) | ||
.expoFont(.caption2R) | ||
|
||
Text("100명") | ||
.expoColor(ExpoColor.main) | ||
.expoFont(.caption2R) | ||
.padding(.trailing, 31) | ||
} | ||
.padding(.top, 13) | ||
|
||
infoList() | ||
.padding(.top, 12) | ||
|
||
ForEach(1..<10, id: \.self) { index in | ||
ExpoProgramDetail(programNum: index, userName: "서지완", affiliation: "고등학교", position: "연수자", attendanceState: true, inTime: "10:30") | ||
} | ||
|
||
Spacer() | ||
} | ||
} | ||
|
||
@ViewBuilder | ||
func infoList() -> some View { | ||
VStack(spacing: 16) { | ||
Rectangle() | ||
.expoColor(ExpoColor.gray600) | ||
.frame(height: 0.7) | ||
HStack(spacing: 0) { | ||
Text("성명") | ||
.padding(.leading, 54) | ||
|
||
Text("소속") | ||
.padding(.leading, 36) | ||
Text("직급") | ||
.padding(.leading, 36) | ||
|
||
Text("출석여부") | ||
.padding(.leading, 36) | ||
|
||
Text("입실시간") | ||
.padding(.leading, 36) | ||
|
||
Spacer() | ||
} | ||
.expoFont(.caption1B) | ||
.expoColor(ExpoColor.gray600) | ||
|
||
Rectangle() | ||
.expoColor(ExpoColor.gray600) | ||
.frame(height: 0.7) | ||
} | ||
.padding(.bottom, 16) | ||
} | ||
} | ||
|
||
#Preview { | ||
ProgramDetailView() | ||
} |