Skip to content

Commit

Permalink
[Design] #252 - .systemMedium 타입 위젯 뷰 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
yungu0010 committed Apr 19, 2024
1 parent 713415d commit 434cbdb
Showing 1 changed file with 69 additions and 3 deletions.
72 changes: 69 additions & 3 deletions iOS-NOTTODO/Widget-NOTTODO/View/MediumFamily.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,79 @@
//

import SwiftUI
import WidgetKit

struct MediumFamily: View {
var entry: Provider.Entry

var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
HStack {
VStack {
ZStack {
Text("")
.foregroundStyle(Color.black)
.font(.custom("Pretendard", size: 18))
.fontWeight(.semibold)
CircularProgressBarView(percent: 0.5, size: 42, lineWidth: 4.34)}
Spacer()
}
.padding(.top, 14)
.padding(.leading, 17)
// .background(.teal)

VStack {
Text("성공한상위십퍼센트는하하글자수가과연어디까지일까요하하하먼저하지말아야할어쩌구저쩌구")
.foregroundStyle(.gray3)
.font(.custom("Pretendard", size: 10))
.fontWeight(.regular)
.lineLimit(2)
.padding(.horizontal, 12)
.padding(.top, 18)
// .background(.orange)

HorizontalDivider(color: .gray5)
.padding(.top, 6)

VStack(spacing: 9) {
if entry.lastThreeTask.isEmpty {
Button(action: {
print("앱으로 이동")
}, label: {
Image(.icPlusDark)
.imageScale(.large)
})
.buttonStyle(.plain)
.position(x: 10, y: 9)
} else {
ForEach(entry.lastThreeTask.prefix(3)) { task in
HStack {
Toggle("", isOn: task.$isCompleted)
.toggleStyle(CheckboxToggleStyle())

Text(task.missionTitle)
.foregroundStyle(.gray1)
.font(.custom("Pretendard-Regular", size: 11))
.fontWeight(.regular)
Spacer()
}
.padding(.leading, 16)
.frame(height: 20)
}
}
}
// .background(.blue)

Spacer()
}
// .background(.green)
.padding(.trailing, 22)
}
.background(.white)
}
}

#Preview {
MediumFamily()
#Preview(as: .systemMedium) {
Widget_NOTTODO()
} timeline: {
SimpleEntry(lastThreeTask: MissionDataModel.shared.model)
}

0 comments on commit 434cbdb

Please sign in to comment.