Skip to content

Commit

Permalink
feat: EvaluateCell(#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
sozohoy committed Mar 1, 2024
1 parent 3744932 commit cd7cad8
Showing 1 changed file with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//
// EvaluateCell.swift
// SUWIKI
//
// Created by ν•œμ§€μ„ on 2/29/24.
//

import SwiftUI

struct EvaluateCell: View {

var semester: String
var totalAvg: Double
var content: String

var body: some View {
VStack(alignment: .leading, spacing: 0) {
semesterLabel
.padding(.top, 12)
.padding(.bottom, 14)
avarageStar
.padding(.bottom, 14)
postContent
.padding(.bottom, 12)
}
.padding(.horizontal, 12)
.background(Color.white)
}

var semesterLabel: some View {
HStack {
RoundedRectangle(cornerRadius: 10)
.frame(width: 50, height: 21)
.foregroundStyle(Color(uiColor: .grayF6))
.overlay {
Text(semester)
.font(.c4)
.foregroundStyle(Color(uiColor: .gray6A))
}
Spacer()
}

}

var avarageStar: some View {
Stars(avarage: totalAvg,
width: 12,
height: 12)
}

var postContent: some View {
Text(content)
.font(.b7)
.lineSpacing(2)
.truncationMode(.tail)
}
}

#Preview {
EvaluateCell(semester: "2022-2", totalAvg: 3.5, content: "거의 ν•œ ν•™κΈ° νŒ€ν”Œν•˜μ‹œλŠ”λ°...νŒ€μ› 잘 λ§Œλ‚˜λ©΄ 잘 λͺ¨λ₯΄κ² λ„€μš”.ꡉμž₯히 였거의 ν•œ ν•™κΈ° νŒ€ν”Œν•˜μ‹œλŠ”λ°...νŒ€μ› 잘 λ§Œλ‚˜λ©΄ 잘 λͺ¨λ₯΄κ² λ„€μš”.ꡉμž₯νžˆμ˜€ν”ˆ λ§ˆμΈλ“œμ‹œκΈ΄ν•΄μš”.\nμ „ 이 κ΅μˆ˜λ‹˜ μ μ‘ν•˜κΈ° νž˜λ“€μ—ˆμ–΄μš”.\nꡉμž₯히 μ˜€ν”ˆ λ§ˆμΈλ“œμ‹œκΈ΄ν•΄μš”.\nμ „ 이 κ΅μˆ˜λ‹˜ μ μ‘ν•˜κΈ° νž˜λ“€μ—ˆμ–΄μš”.")
}

0 comments on commit cd7cad8

Please sign in to comment.