diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..2fcae34 Binary files /dev/null and b/.DS_Store differ diff --git a/ManageDose.xcodeproj/project.pbxproj b/ManageDose.xcodeproj/project.pbxproj index 2923001..62de2ad 100644 --- a/ManageDose.xcodeproj/project.pbxproj +++ b/ManageDose.xcodeproj/project.pbxproj @@ -31,7 +31,7 @@ 7EBEDBBF2C02FA6000DC4035 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBEDBB92C02FA6000DC4035 /* Button.swift */; }; 7EBEDBC32C02FA7200DC4035 /* BudgetingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBEDBC02C02FA7100DC4035 /* BudgetingView.swift */; }; 7EBEDBC42C02FA7200DC4035 /* DetailBudget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBEDBC12C02FA7100DC4035 /* DetailBudget.swift */; }; - 7EBEDBC52C02FA7200DC4035 /* IncomeDetail.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBEDBC22C02FA7100DC4035 /* IncomeDetail.swift */; }; + 7EBEDBC52C02FA7200DC4035 /* IncomeDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EBEDBC22C02FA7100DC4035 /* IncomeDetailView.swift */; }; 7EBEDBC92C02FB2E00DC4035 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7EBEDBC82C02FB2E00DC4035 /* Preview Assets.xcassets */; }; /* End PBXBuildFile section */ @@ -61,7 +61,7 @@ 7EBEDBB92C02FA6000DC4035 /* Button.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Button.swift; path = ManageDose/Components/Button.swift; sourceTree = SOURCE_ROOT; }; 7EBEDBC02C02FA7100DC4035 /* BudgetingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BudgetingView.swift; sourceTree = ""; }; 7EBEDBC12C02FA7100DC4035 /* DetailBudget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailBudget.swift; sourceTree = ""; }; - 7EBEDBC22C02FA7100DC4035 /* IncomeDetail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IncomeDetail.swift; sourceTree = ""; }; + 7EBEDBC22C02FA7100DC4035 /* IncomeDetailView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IncomeDetailView.swift; sourceTree = ""; }; 7EBEDBC82C02FB2E00DC4035 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -128,7 +128,6 @@ 7E9506CD2BFB3E7E00BDF341 /* Components */ = { isa = PBXGroup; children = ( - 7EBEDBC22C02FA7100DC4035 /* IncomeDetail.swift */, 7EBEDBB42C02FA6000DC4035 /* AddButton.swift */, 7EBEDBB72C02FA6000DC4035 /* BudgetProgressCard.swift */, 7EBEDBB92C02FA6000DC4035 /* Button.swift */, @@ -151,6 +150,7 @@ 7EBEDBC02C02FA7100DC4035 /* BudgetingView.swift */, 7E9506C92BFB35C200BDF341 /* TransactionHistoryView.swift */, 7E71FC382BFAEC2500F58890 /* HomeView.swift */, + 7EBEDBC22C02FA7100DC4035 /* IncomeDetailView.swift */, 3F76959B2C0037EF00FEE52D /* AddNewExpenseView.swift */, ); path = Views; @@ -262,7 +262,7 @@ 7EB947E42BFB59EB00A7C723 /* TransactionHistoryViewModel.swift in Sources */, 7EBEDBBC2C02FA6000DC4035 /* IncomeCard.swift in Sources */, 3F76959C2C0037EF00FEE52D /* AddNewExpenseView.swift in Sources */, - 7EBEDBC52C02FA7200DC4035 /* IncomeDetail.swift in Sources */, + 7EBEDBC52C02FA7200DC4035 /* IncomeDetailView.swift in Sources */, 7E9506CA2BFB35C200BDF341 /* TransactionHistoryView.swift in Sources */, 7E0EDBB42BF6F66E00C384B8 /* ManageDoseApp.swift in Sources */, 3F7695982C00238600FEE52D /* AddNewExpenseCard.swift in Sources */, diff --git a/ManageDose.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate b/ManageDose.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..ffabf93 Binary files /dev/null and b/ManageDose.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ManageDose.xcodeproj/xcuserdata/mac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ManageDose.xcodeproj/xcuserdata/mac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..3225d3b --- /dev/null +++ b/ManageDose.xcodeproj/xcuserdata/mac.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/ManageDose.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist b/ManageDose.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..bb4883c --- /dev/null +++ b/ManageDose.xcodeproj/xcuserdata/mac.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + ManageDose.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/ManageDose/.DS_Store b/ManageDose/.DS_Store index e168416..86c8712 100644 Binary files a/ManageDose/.DS_Store and b/ManageDose/.DS_Store differ diff --git a/ManageDose/Assets.xcassets/.DS_Store b/ManageDose/Assets.xcassets/.DS_Store index 9eb897d..a03486f 100644 Binary files a/ManageDose/Assets.xcassets/.DS_Store and b/ManageDose/Assets.xcassets/.DS_Store differ diff --git a/ManageDose/Components/BudgetProgressCard.swift b/ManageDose/Components/BudgetProgressCard.swift index 0fd4e1c..a306965 100644 --- a/ManageDose/Components/BudgetProgressCard.swift +++ b/ManageDose/Components/BudgetProgressCard.swift @@ -43,7 +43,7 @@ struct TopCornersRoundedShape: Shape { struct BudgetProgressCard: View { let progressPercentage: Double = 0.7 - let colorAlert: String + let colorAlert: Color var body: some View { ZStack(alignment: .topLeading){ //logo and progress @@ -75,10 +75,11 @@ struct BudgetProgressCard: View { ZStack(alignment: .leading){ Capsule() .frame(width: UIScreen.main.bounds.width-80) - .foregroundColor(Color("#E2E2E2")) + .foregroundColor(Color(red: 226 / 255, green: 226 / 255, blue: 226 / 255, opacity: 1)) Capsule() .frame(width: CGFloat(progressPercentage) * (UIScreen.main.bounds.width - 80)) - .foregroundColor(Color("#1FCA9D")) + .foregroundColor(Color(red: 31 / 255, green: 202 / 255, blue: 157 / 255, opacity: 1)) + } .frame(height: 6) .padding(.top, 8) @@ -102,7 +103,7 @@ struct BudgetProgressCard: View { .frame(height: 110) .padding(15) .padding(.top, 45) - .background(Color("#F6F6F6")) + .background(Color(red: 246 / 255, green: 246 / 255, blue: 246 / 255, opacity: 1)) .cornerRadius(10) //reminder @@ -119,7 +120,7 @@ struct BudgetProgressCard: View { } .frame(maxWidth: 400, alignment: .leading) .padding(15) - .background(Color("\(colorAlert)")) + .background(colorAlert) .clipShape(TopCornersRoundedShape(radius: 10)) } @@ -127,5 +128,5 @@ struct BudgetProgressCard: View { } #Preview { - BudgetProgressCard(colorAlert: "#E93700") + BudgetProgressCard(colorAlert: Color(red: 31 / 255, green: 202 / 255, blue: 157 / 255, opacity: 1)) } diff --git a/ManageDose/Components/IncomeDetail.swift b/ManageDose/Components/IncomeDetail.swift deleted file mode 100644 index 8341bc2..0000000 --- a/ManageDose/Components/IncomeDetail.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// IncomeDetail.swift -// ManageDose -// -// Created by MacBook Pro on 26/05/24. -// - -import SwiftUI - -struct IncomeDetail: View { - var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) - } -} - -#Preview { - IncomeDetail() -} diff --git a/ManageDose/Extension/ColorExtension.swift b/ManageDose/Extension/ColorExtension.swift index 61d0057..46c0e44 100644 --- a/ManageDose/Extension/ColorExtension.swift +++ b/ManageDose/Extension/ColorExtension.swift @@ -7,12 +7,26 @@ import SwiftUI -struct ColorExtension: View { - var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) +extension Color { + init(hex: String) { + let scanner = Scanner(string: hex) + scanner.currentIndex = hex.startIndex + + var rgbValue: UInt64 = 0 + scanner.scanHexInt64(&rgbValue) + + let r = (rgbValue & 0xff0000) >> 16 + let g = (rgbValue & 0x00ff00) >> 8 + let b = rgbValue & 0x0000ff + + self.init( + .sRGB, + red: Double(r) / 255, + green: Double(g) / 255, + blue: Double(b) / 255, + opacity: 1 + ) } } -#Preview { - ColorExtension() -} + diff --git a/ManageDose/Views/BudgetingView.swift b/ManageDose/Views/BudgetingView.swift index 9d7701f..f6a90d6 100644 --- a/ManageDose/Views/BudgetingView.swift +++ b/ManageDose/Views/BudgetingView.swift @@ -40,10 +40,10 @@ struct BudgetingView: View { } .padding(EdgeInsets(top: 5, leading: 15, bottom: 0, trailing: 20)) NavigationLink(destination: DetailBudget()) { - BudgetProgressCard(colorAlert: "#1FCA9D") + BudgetProgressCard(colorAlert: Color(red: 31 / 255, green: 202 / 255, blue: 157 / 255, opacity: 1)) } - BudgetProgressCard(colorAlert: "#5339EE") - BudgetProgressCard(colorAlert: "#E93700") + BudgetProgressCard(colorAlert: Color(red: 31 / 255, green: 202 / 255, blue: 157 / 255, opacity: 1)) + BudgetProgressCard(colorAlert: Color(red: 31 / 255, green: 202 / 255, blue: 157 / 255, opacity: 1)) } .padding(.horizontal) } diff --git a/ManageDose/Views/DetailBudget.swift b/ManageDose/Views/DetailBudget.swift index c50381e..6738cc4 100644 --- a/ManageDose/Views/DetailBudget.swift +++ b/ManageDose/Views/DetailBudget.swift @@ -10,7 +10,7 @@ import SwiftUI struct DetailBudget: View { var body: some View { VStack{ - BudgetProgressCard(colorAlert: "#1FCA9D") + BudgetProgressCard(colorAlert: Color(red: 31 / 255, green: 202 / 255, blue: 157 / 255, opacity: 1)) .padding(.top, 10) Rectangle() .fill(Color(red: 220/255, green: 213/255, blue: 255/255, opacity: 1)) diff --git a/ManageDose/Views/IncomeDetailView.swift b/ManageDose/Views/IncomeDetailView.swift new file mode 100644 index 0000000..ad24013 --- /dev/null +++ b/ManageDose/Views/IncomeDetailView.swift @@ -0,0 +1,88 @@ +// +// IncomeDetail.swift +// ManageDose +// +// Created by MacBook Pro on 26/05/24. +// + +import SwiftUI + +struct IncomeDetailView: View { + var body: some View { + VStack{ + VStack(alignment: .leading){ + Text("Insert Insertion Source") + .font(.title3) + .fontWeight(.semibold) + Text("Enter Your Income in one month") + .font(.system(size: 14)) + .fontWeight(.semibold) + .foregroundStyle(.gray) + } + .padding(.horizontal, 15) + .frame(maxWidth: .infinity, alignment: .leading) + Rectangle() + .fill(Color(red: 220/255, green: 213/255, blue: 255/255, opacity: 1)) + .frame(width:400, height: 10) + .offset(y: 8) + ScrollView(.vertical, showsIndicators: false){ + LazyVStack(){ + ExpenseCard() + ExpenseCard() + ExpenseCard() + ExpenseCard() + ExpenseCard() + ExpenseCard() + ExpenseCard() + ExpenseCard() + + } + + } + .overlay( + HStack{ + Spacer() + ZStack { + Circle() + .fill(Color(red: 83/255, green: 57/255, blue: 238/255, opacity: 1)) + .frame(width: 60, height: 60) + Image(systemName: "plus") + .font(.title) + .foregroundColor(.white) + } + } + .offset(x: -10, y: 230) + ) + + Divider() + .background(Color.gray) + .frame(width:400) + .offset(y: -8) + + + HStack{ + Text("Total Income") + .font(.system(size: 18)) + .fontWeight(.regular) + .foregroundStyle(.gray) + + Spacer() + Text("Rp. 23.112.999") + .font(.title3) + .fontWeight(.semibold) + } + .padding(.top, 0) + CustomButton() + } + .padding(.horizontal, 15) + .navigationBarTitle(Text("Detail Budget") + .font(.title3) + .fontWeight(.semibold) + , displayMode: .inline) + + } +} + +#Preview { + IncomeDetailView() +}