Skip to content

Commit

Permalink
✨[feat]: 출석 현황 관련해서 구현 #38
Browse files Browse the repository at this point in the history
* 출석 현황 상태 카드 추가
  • Loading branch information
Roy-wonji committed Jan 27, 2025
1 parent bc07a2f commit fe6d298
Show file tree
Hide file tree
Showing 13 changed files with 242 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,37 @@ public enum AttendanceType: String, Codable {
return "NONE"
}
}

public var koreanDesc: String {
switch self {
case .present:
return "출석"
case .absent:
return "결석"
case .late:
return "지각"
case .run:
return "탈주"

default:
return ""

}
}

public var imageDesc: String {
switch self {
case .present:
return "Present_icons"
case .absent:
return "Abesent_icons"
case .late:
return "Late_icons"

default:
return "Present_icons"

}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ public enum SelectPart: String, CaseIterable, Codable, Equatable {

public var attendanceListDesc: String {
switch self {
case .all:
return "전체"
case .pm:
return "PM"
return "Product Manager"
case .design:
return "Designer"
case .android:
return "Android"
case .iOS:
return "iOS"
case .web:
return "FE"
return "Frontend"
case .server:
return "BE"
return "Backend"
default:
return ""
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,24 @@ public enum SelectTeam: String, CaseIterable, Codable {
public var isDescEqualToAttendanceListDesc: Bool {
return desc == attendanceListDesc
}

public var attandanceCardDesc: String {
switch self {
case .web1:
return "Web1팀"
case .web2:
return "Web2팀"
case .and1:
return "Android1팀"
case .and2:
return "Android2팀"
case .ios1:
return "iOS1팀"
case .ios2:
return "iOS2팀"
default:
return ""
} }


}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ struct AttandanceCheckView: View {

selectPartType()


AttendanceCheckStatusCard(attandanceType: .present, selectPart: .design, selectTeam: store.selectPart ?? .ios1, name: "김디디")
.padding(.horizontal, 24)
}
}
}
Expand Down
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,21 @@
{
"images" : [
{
"filename" : "Abesent_icons.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "Late_icons.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,21 @@
{
"images" : [
{
"filename" : "Present_icons.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
Expand Up @@ -43,4 +43,10 @@ public enum ImageAsset: String {
// MARK: - 멤버 출석 현황

case danger


//MARK: - attandance
case Abesent_icons
case Late_icons
case Present_icons
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//
// AttendanceCheckStatusCard.swift
// DesignSystem
//
// Created by Wonji Suh on 1/27/25.
//

import SwiftUI
import Model

public struct AttendanceCheckStatusCard: View {
private let attandanceType: AttendanceType
private let selectPart: SelectPart
private let selectTeam: SelectTeam
private let name: String

public init(
attandanceType: AttendanceType,
selectPart: SelectPart,
selectTeam: SelectTeam,
name: String
) {
self.attandanceType = attandanceType
self.selectPart = selectPart
self.selectTeam = selectTeam
self.name = name
}

public var body: some View {
VStack {
VStack(spacing: .zero) {
Spacer()
.frame(height: 16)

HStack {
VStack(alignment: .leading, spacing: .zero) {
HStack {
Text(name)
.pretendardCustomFont(textStyle: .title3NormalBold)
.foregroundStyle(.staticWhite)
Spacer()
}

Text("\(selectTeam.attandanceCardDesc) / \(selectPart.attendanceListDesc) ")
.pretendardCustomFont(textStyle: .body2NormalBold)
.foregroundStyle(.staticWhite)
}

Spacer()

HStack(spacing: .zero) {
Text(attandanceType.koreanDesc)
.pretendardCustomFont(textStyle: .body2NormalMedium)
.foregroundStyle(.staticWhite)

Spacer()
.frame(width: 12)

Image(assetName: attandanceType.imageDesc)
.resizable()
.scaledToFit()
.frame(width: 24, height: 24)
}

}


Spacer()
.frame(height: 16)
}
.padding(.horizontal, 20)
}
.background(.borderInverse)
.frame(height: 84)
.cornerRadius(15)
}
}

0 comments on commit fe6d298

Please sign in to comment.