Skip to content

Commit

Permalink
πŸ’„ :: [#74] SceneApplicationInfoListDetail Component μΆ”κ°€
Browse files Browse the repository at this point in the history
  • Loading branch information
Xixn2 committed Jan 12, 2025
1 parent 885d3fd commit f9c685f
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "okIcon.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
//
// SceneApplicationInfoListDetail.swift
// Expo-iOS
//
// Created by μ„œμ§€μ™„ on 1/12/25.
// Copyright Β© 2025 SchoolofCompany. All rights reserved.
//

import SwiftUI

public struct SceneApplicationInfoListDetail: View {
var programNum: Int
var userName: String
var affiliation: String
var position: String
var phoneNumber: String
var consentStatus: Bool
var action: () -> Void

@State private var isPressed = false

public init(
programNum: Int,
userName: String,
affiliation: String,
position: String,
phoneNumber: String,
consentStatus: Bool,
action: @escaping () -> Void = {}
) {
self.programNum = programNum
self.userName = userName
self.affiliation = affiliation
self.position = position
self.phoneNumber = phoneNumber
self.consentStatus = consentStatus
self.action = action
}

public var body: some View {
Button(action: {
self.action()
}) {
HStack(spacing: 0) {
Text("\(programNum)")
.expoFont(.caption1B)
.padding(.leading, 8)
.frame(width: 50, alignment: .leading)

Text(userName)
.frame(width: 70, alignment: .leading)

Text(affiliation)
.frame(width: 70, alignment: .leading)

Text(position)
.frame(width: 70, alignment: .leading)

Text(phoneNumber)
.frame(width: 170, alignment: .leading)

Image(consentStatus ? "okIcon" : "ButtonX")
.frame(width: 130, alignment: .center)
}
.padding(.bottom, 36)
.expoFont(.caption2R)
}
.buttonStyle(PlainButtonStyle())
.gesture(
DragGesture(minimumDistance: 0)
.onChanged { _ in self.isPressed = true }
.onEnded { _ in
self.isPressed = false
self.action()
}
)
}
}

#Preview {
UserManagementView()
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ struct ProgramView: View {

Spacer()
}


}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,26 @@ struct UserManagementView: View {

ScrollView(showsIndicators: false) {
ForEach(1..<10, id: \.self) { index in
ExpoProgramDetail(
programNum: index,
userName: "μ„œμ§€μ™„",
affiliation: "고등학ꡐ",
position: "μ—°μˆ˜μž",
attendanceState: true,
inTime: "10:30",
outTime: "11:30"
)
if userInfoListName == "ν˜„μž₯ μ‹ μ²­" {
SceneApplicationInfoListDetail(
programNum: index,
userName: "μ„œμ§€μ™„",
affiliation: "고등학ꡐ",
position: "μ—°μˆ˜μž",
phoneNumber: "01062860063",
consentStatus: true
)
} else {
ExpoProgramDetail(
programNum: index,
userName: "μ„œμ§€μ™„",
affiliation: "고등학ꡐ",
position: "μ—°μˆ˜μž",
attendanceState: true,
inTime: "10:30",
outTime: "11:30"
)
}
}
.frame(maxWidth: .infinity, alignment: .leading)
}
Expand Down

0 comments on commit f9c685f

Please sign in to comment.