From 434cbdbe4ee419ea4da3e1fe53eaad837b7f07c1 Mon Sep 17 00:00:00 2001 From: yungu0010 Date: Fri, 19 Apr 2024 14:13:45 +0900 Subject: [PATCH] =?UTF-8?q?[Design]=20#252=20-=20.systemMedium=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=20=EC=9C=84=EC=A0=AF=20=EB=B7=B0=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Widget-NOTTODO/View/MediumFamily.swift | 72 ++++++++++++++++++- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/iOS-NOTTODO/Widget-NOTTODO/View/MediumFamily.swift b/iOS-NOTTODO/Widget-NOTTODO/View/MediumFamily.swift index f9ea64a..0178e27 100644 --- a/iOS-NOTTODO/Widget-NOTTODO/View/MediumFamily.swift +++ b/iOS-NOTTODO/Widget-NOTTODO/View/MediumFamily.swift @@ -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) }