HomeRootView.swift 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. import CoreData
  2. import SpriteKit
  3. import SwiftDate
  4. import SwiftUI
  5. import Swinject
  6. extension Home {
  7. struct RootView: BaseView {
  8. let resolver: Resolver
  9. @StateObject var state = StateModel()
  10. @State var isStatusPopupPresented = false
  11. @State var showCancelAlert = false
  12. @Environment(\.managedObjectContext) var moc
  13. @Environment(\.colorScheme) var colorScheme
  14. @FetchRequest(
  15. entity: Override.entity(),
  16. sortDescriptors: [NSSortDescriptor(key: "date", ascending: false)]
  17. ) var fetchedPercent: FetchedResults<Override>
  18. @FetchRequest(
  19. entity: OverridePresets.entity(),
  20. sortDescriptors: [NSSortDescriptor(key: "name", ascending: true)], predicate: NSPredicate(
  21. format: "name != %@", "" as String
  22. )
  23. ) var fetchedProfiles: FetchedResults<OverridePresets>
  24. @FetchRequest(
  25. entity: TempTargets.entity(),
  26. sortDescriptors: [NSSortDescriptor(key: "date", ascending: false)]
  27. ) var sliderTTpresets: FetchedResults<TempTargets>
  28. @FetchRequest(
  29. entity: TempTargetsSlider.entity(),
  30. sortDescriptors: [NSSortDescriptor(key: "date", ascending: false)]
  31. ) var enactedSliderTT: FetchedResults<TempTargetsSlider>
  32. private var numberFormatter: NumberFormatter {
  33. let formatter = NumberFormatter()
  34. formatter.numberStyle = .decimal
  35. formatter.maximumFractionDigits = 2
  36. return formatter
  37. }
  38. private var fetchedTargetFormatter: NumberFormatter {
  39. let formatter = NumberFormatter()
  40. formatter.numberStyle = .decimal
  41. if state.units == .mmolL {
  42. formatter.maximumFractionDigits = 1
  43. } else { formatter.maximumFractionDigits = 0 }
  44. return formatter
  45. }
  46. private var targetFormatter: NumberFormatter {
  47. let formatter = NumberFormatter()
  48. formatter.numberStyle = .decimal
  49. formatter.maximumFractionDigits = 1
  50. return formatter
  51. }
  52. private var tirFormatter: NumberFormatter {
  53. let formatter = NumberFormatter()
  54. formatter.numberStyle = .decimal
  55. formatter.maximumFractionDigits = 0
  56. return formatter
  57. }
  58. private var dateFormatter: DateFormatter {
  59. let dateFormatter = DateFormatter()
  60. dateFormatter.timeStyle = .short
  61. return dateFormatter
  62. }
  63. private var spriteScene: SKScene {
  64. let scene = SnowScene()
  65. scene.scaleMode = .resizeFill
  66. scene.backgroundColor = .clear
  67. return scene
  68. }
  69. @ViewBuilder func header(_ geo: GeometryProxy) -> some View {
  70. HStack(alignment: .bottom) {
  71. Spacer()
  72. cobIobView
  73. Spacer()
  74. glucoseView
  75. Spacer()
  76. pumpView
  77. Spacer()
  78. loopView
  79. Spacer()
  80. }
  81. .frame(maxWidth: .infinity)
  82. .padding(.top, 10 + geo.safeAreaInsets.top)
  83. .padding(.bottom, 10)
  84. .background(Color.gray.opacity(0.3))
  85. }
  86. var cobIobView: some View {
  87. VStack(alignment: .leading, spacing: 12) {
  88. HStack {
  89. Text("IOB").font(.footnote).foregroundColor(.secondary)
  90. Text(
  91. (numberFormatter.string(from: (state.suggestion?.iob ?? 0) as NSNumber) ?? "0") +
  92. NSLocalizedString(" U", comment: "Insulin unit")
  93. )
  94. .font(.footnote).fontWeight(.bold)
  95. }.frame(alignment: .top)
  96. HStack {
  97. Text("COB").font(.footnote).foregroundColor(.secondary)
  98. Text(
  99. (numberFormatter.string(from: (state.suggestion?.cob ?? 0) as NSNumber) ?? "0") +
  100. NSLocalizedString(" g", comment: "gram of carbs")
  101. )
  102. .font(.footnote).fontWeight(.bold)
  103. }.frame(alignment: .bottom)
  104. }
  105. }
  106. var glucoseView: some View {
  107. CurrentGlucoseView(
  108. recentGlucose: $state.recentGlucose,
  109. timerDate: $state.timerDate,
  110. delta: $state.glucoseDelta,
  111. units: $state.units,
  112. alarm: $state.alarm,
  113. lowGlucose: $state.lowGlucose,
  114. highGlucose: $state.highGlucose
  115. )
  116. .onTapGesture {
  117. if state.alarm == nil {
  118. state.openCGM()
  119. } else {
  120. state.showModal(for: .snooze)
  121. }
  122. }
  123. .onLongPressGesture {
  124. let impactHeavy = UIImpactFeedbackGenerator(style: .heavy)
  125. impactHeavy.impactOccurred()
  126. if state.alarm == nil {
  127. state.showModal(for: .snooze)
  128. } else {
  129. state.openCGM()
  130. }
  131. }
  132. }
  133. var pumpView: some View {
  134. PumpView(
  135. reservoir: $state.reservoir,
  136. battery: $state.battery,
  137. name: $state.pumpName,
  138. expiresAtDate: $state.pumpExpiresAtDate,
  139. timerDate: $state.timerDate,
  140. timeZone: $state.timeZone
  141. )
  142. .onTapGesture {
  143. if state.pumpDisplayState != nil {
  144. state.setupPump = true
  145. }
  146. }
  147. }
  148. var loopView: some View {
  149. LoopView(
  150. suggestion: $state.suggestion,
  151. enactedSuggestion: $state.enactedSuggestion,
  152. closedLoop: $state.closedLoop,
  153. timerDate: $state.timerDate,
  154. isLooping: $state.isLooping,
  155. lastLoopDate: $state.lastLoopDate,
  156. manualTempBasal: $state.manualTempBasal
  157. ).onTapGesture {
  158. isStatusPopupPresented = true
  159. }.onLongPressGesture {
  160. let impactHeavy = UIImpactFeedbackGenerator(style: .heavy)
  161. impactHeavy.impactOccurred()
  162. state.runLoop()
  163. }
  164. }
  165. var tempBasalString: String? {
  166. guard let tempRate = state.tempRate else {
  167. return nil
  168. }
  169. let rateString = numberFormatter.string(from: tempRate as NSNumber) ?? "0"
  170. var manualBasalString = ""
  171. if state.apsManager.isManualTempBasal {
  172. manualBasalString = NSLocalizedString(
  173. " - Manual Basal ⚠️",
  174. comment: "Manual Temp basal"
  175. )
  176. }
  177. return rateString + NSLocalizedString(" U/hr", comment: "Unit per hour with space") + manualBasalString
  178. }
  179. var tempTargetString: String? {
  180. guard let tempTarget = state.tempTarget else {
  181. return nil
  182. }
  183. let target = tempTarget.targetBottom ?? 0
  184. let unitString = targetFormatter.string(from: (tempTarget.targetBottom?.asMmolL ?? 0) as NSNumber) ?? ""
  185. let rawString = (tirFormatter.string(from: (tempTarget.targetBottom ?? 0) as NSNumber) ?? "") + " " + state.units
  186. .rawValue
  187. var string = ""
  188. if sliderTTpresets.first?.active ?? false {
  189. let hbt = sliderTTpresets.first?.hbt ?? 0
  190. string = ", " + (tirFormatter.string(from: state.infoPanelTTPercentage(hbt, target) as NSNumber) ?? "") + " %"
  191. }
  192. let percentString = state
  193. .units == .mmolL ? (unitString + " mmol/L" + string) : (rawString + (string == "0" ? "" : string))
  194. return tempTarget.displayName + " " + percentString
  195. }
  196. var overrideString: String? {
  197. guard fetchedPercent.first?.enabled ?? false else {
  198. return nil
  199. }
  200. var percentString = "\((fetchedPercent.first?.percentage ?? 100).formatted(.number)) %"
  201. var target = (fetchedPercent.first?.target ?? 100) as Decimal
  202. let indefinite = (fetchedPercent.first?.indefinite ?? false)
  203. let unit = state.units.rawValue
  204. if state.units == .mmolL {
  205. target = target.asMmolL
  206. }
  207. var targetString = (fetchedTargetFormatter.string(from: target as NSNumber) ?? "") + " " + unit
  208. if tempTargetString != nil || target == 0 { targetString = "" }
  209. percentString = percentString == "100 %" ? "" : percentString
  210. let duration = (fetchedPercent.first?.duration ?? 0) as Decimal
  211. let addedMinutes = Int(duration)
  212. let date = fetchedPercent.first?.date ?? Date()
  213. var newDuration: Decimal = 0
  214. if date.addingTimeInterval(addedMinutes.minutes.timeInterval) > Date() {
  215. newDuration = Decimal(Date().distance(to: date.addingTimeInterval(addedMinutes.minutes.timeInterval)).minutes)
  216. }
  217. var durationString = indefinite ?
  218. "" : newDuration >= 1 ?
  219. (newDuration.formatted(.number.grouping(.never).rounded().precision(.fractionLength(0))) + " min") :
  220. (
  221. newDuration > 0 ? (
  222. (newDuration * 60).formatted(.number.grouping(.never).rounded().precision(.fractionLength(0))) + " s"
  223. ) :
  224. ""
  225. )
  226. let smbToggleString = (fetchedPercent.first?.smbIsOff ?? false) ? " \u{20e0}" : ""
  227. var comma1 = ", "
  228. var comma2 = comma1
  229. var comma3 = comma1
  230. if targetString == "" || percentString == "" { comma1 = "" }
  231. if durationString == "" { comma2 = "" }
  232. if smbToggleString == "" { comma3 = "" }
  233. if percentString == "", targetString == "" {
  234. comma1 = ""
  235. comma2 = ""
  236. }
  237. if percentString == "", targetString == "", smbToggleString == "" {
  238. durationString = ""
  239. comma1 = ""
  240. comma2 = ""
  241. comma3 = ""
  242. }
  243. if durationString == "" {
  244. comma2 = ""
  245. }
  246. if smbToggleString == "" {
  247. comma3 = ""
  248. }
  249. if durationString == "", !indefinite {
  250. return nil
  251. }
  252. return percentString + comma1 + targetString + comma2 + durationString + comma3 + smbToggleString
  253. }
  254. var infoPanel: some View {
  255. HStack(alignment: .center) {
  256. if state.pumpSuspended {
  257. Text("Pump suspended")
  258. .font(.system(size: 12, weight: .bold)).foregroundColor(.loopGray)
  259. .padding(.leading, 8)
  260. } else if let tempBasalString = tempBasalString {
  261. Text(tempBasalString)
  262. .font(.system(size: 12, weight: .bold))
  263. .foregroundColor(.insulin)
  264. .padding(.leading, 8)
  265. }
  266. if let tempTargetString = tempTargetString {
  267. Text(tempTargetString)
  268. .font(.caption)
  269. .foregroundColor(.secondary)
  270. }
  271. Spacer()
  272. if let overrideString = overrideString {
  273. Text("👤 " + overrideString)
  274. .font(.system(size: 12))
  275. .foregroundColor(.secondary)
  276. .padding(.trailing, 8)
  277. }
  278. if state.closedLoop, state.settingsManager.preferences.maxIOB == 0 {
  279. Text("Max IOB: 0").font(.callout).foregroundColor(.orange).padding(.trailing, 20)
  280. }
  281. if let progress = state.bolusProgress {
  282. Text("Bolusing")
  283. .font(.system(size: 12, weight: .bold)).foregroundColor(.insulin)
  284. ProgressView(value: Double(progress))
  285. .progressViewStyle(BolusProgressViewStyle())
  286. .padding(.trailing, 8)
  287. .onTapGesture {
  288. state.cancelBolus()
  289. }
  290. }
  291. }
  292. .frame(maxWidth: .infinity, maxHeight: 30)
  293. }
  294. var legendPanel: some View {
  295. ZStack {
  296. HStack(alignment: .center) {
  297. Group {
  298. Circle().fill(Color.loopGreen).frame(width: 8, height: 8)
  299. Text("BG")
  300. .font(.system(size: 12, weight: .bold)).foregroundColor(.loopGreen)
  301. }
  302. Group {
  303. Circle().fill(Color.insulin).frame(width: 8, height: 8)
  304. .padding(.leading, 8)
  305. Text("IOB")
  306. .font(.system(size: 12, weight: .bold)).foregroundColor(.insulin)
  307. }
  308. Group {
  309. Circle().fill(Color.zt).frame(width: 8, height: 8)
  310. .padding(.leading, 8)
  311. Text("ZT")
  312. .font(.system(size: 12, weight: .bold)).foregroundColor(.zt)
  313. }
  314. Group {
  315. Circle().fill(Color.loopYellow).frame(width: 8, height: 8)
  316. .padding(.leading, 8)
  317. Text("COB")
  318. .font(.system(size: 12, weight: .bold)).foregroundColor(.loopYellow)
  319. }
  320. Group {
  321. Circle().fill(Color.uam).frame(width: 8, height: 8)
  322. .padding(.leading, 8)
  323. Text("UAM")
  324. .font(.system(size: 12, weight: .bold)).foregroundColor(.uam)
  325. }
  326. if let eventualBG = state.eventualBG {
  327. Text(
  328. "⇢ " + numberFormatter.string(
  329. from: (state.units == .mmolL ? eventualBG.asMmolL : Decimal(eventualBG)) as NSNumber
  330. )!
  331. )
  332. .font(.system(size: 12, weight: .bold)).foregroundColor(.secondary)
  333. }
  334. }
  335. .frame(maxWidth: .infinity)
  336. .padding([.bottom], 20)
  337. }
  338. }
  339. var mainChart: some View {
  340. ZStack {
  341. if state.animatedBackground {
  342. SpriteView(scene: spriteScene, options: [.allowsTransparency])
  343. .ignoresSafeArea()
  344. .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
  345. }
  346. MainChartView(
  347. glucose: $state.glucose,
  348. isManual: $state.isManual,
  349. suggestion: $state.suggestion,
  350. tempBasals: $state.tempBasals,
  351. boluses: $state.boluses,
  352. suspensions: $state.suspensions,
  353. announcement: $state.announcement,
  354. hours: .constant(state.filteredHours),
  355. maxBasal: $state.maxBasal,
  356. autotunedBasalProfile: $state.autotunedBasalProfile,
  357. basalProfile: $state.basalProfile,
  358. tempTargets: $state.tempTargets,
  359. carbs: $state.carbs,
  360. timerDate: $state.timerDate,
  361. units: $state.units,
  362. smooth: $state.smooth,
  363. highGlucose: $state.highGlucose,
  364. lowGlucose: $state.lowGlucose,
  365. screenHours: $state.screenHours,
  366. displayXgridLines: $state.displayXgridLines,
  367. displayYgridLines: $state.displayYgridLines,
  368. thresholdLines: $state.thresholdLines
  369. )
  370. }
  371. .padding(.bottom)
  372. .modal(for: .dataTable, from: self)
  373. }
  374. @ViewBuilder private func profiles(_: GeometryProxy) -> some View {
  375. let colour: Color = colorScheme == .dark ? .black : .white
  376. // Rectangle().fill(colour).frame(maxHeight: 1)
  377. ZStack {
  378. Rectangle().fill(Color.gray.opacity(0.3)).frame(maxHeight: 40)
  379. let cancel = fetchedPercent.first?.enabled ?? false
  380. HStack(spacing: cancel ? 25 : 15) {
  381. Text(selectedProfile().name).foregroundColor(.secondary)
  382. if cancel, selectedProfile().isOn {
  383. Button { showCancelAlert.toggle() }
  384. label: {
  385. Image(systemName: "xmark")
  386. .foregroundStyle(.secondary)
  387. }
  388. }
  389. Button { state.showModal(for: .overrideProfilesConfig) }
  390. label: {
  391. Image(systemName: "person.3.sequence.fill")
  392. .symbolRenderingMode(.palette)
  393. .foregroundStyle(
  394. !(fetchedPercent.first?.enabled ?? false) ? .green : .cyan,
  395. !(fetchedPercent.first?.enabled ?? false) ? .cyan : .green,
  396. .purple
  397. )
  398. }
  399. }
  400. }
  401. .alert(
  402. "Return to Normal?", isPresented: $showCancelAlert,
  403. actions: {
  404. Button("No", role: .cancel) {}
  405. Button("Yes", role: .destructive) {
  406. state.cancelProfile()
  407. }
  408. }, message: { Text("This will change settings back to your normal profile.") }
  409. )
  410. Rectangle().fill(colour).frame(maxHeight: 1)
  411. }
  412. private func selectedProfile() -> (name: String, isOn: Bool) {
  413. var profileString = ""
  414. var display: Bool = false
  415. let duration = (fetchedPercent.first?.duration ?? 0) as Decimal
  416. let indefinite = fetchedPercent.first?.indefinite ?? false
  417. let addedMinutes = Int(duration)
  418. let date = fetchedPercent.first?.date ?? Date()
  419. if date.addingTimeInterval(addedMinutes.minutes.timeInterval) > Date() || indefinite {
  420. display.toggle()
  421. }
  422. if fetchedPercent.first?.enabled ?? false, !(fetchedPercent.first?.isPreset ?? false), display {
  423. profileString = NSLocalizedString("Custom Profile", comment: "Custom but unsaved Profile")
  424. } else if !(fetchedPercent.first?.enabled ?? false) || !display {
  425. profileString = NSLocalizedString("Normal Profile", comment: "Your normal Profile. Use a short string")
  426. } else {
  427. let id_ = fetchedPercent.first?.id ?? ""
  428. let profile = fetchedProfiles.filter({ $0.id == id_ }).first
  429. if profile != nil {
  430. profileString = profile?.name?.description ?? ""
  431. }
  432. }
  433. return (name: profileString, isOn: display)
  434. }
  435. @ViewBuilder private func bottomPanel(_ geo: GeometryProxy) -> some View {
  436. ZStack {
  437. Rectangle().fill(Color.gray.opacity(0.3)).frame(height: 50 + geo.safeAreaInsets.bottom)
  438. HStack {
  439. Button { state.showModal(for: .addCarbs(editMode: false, override: false)) }
  440. label: {
  441. ZStack(alignment: Alignment(horizontal: .trailing, vertical: .bottom)) {
  442. Image("carbs")
  443. .renderingMode(.template)
  444. .resizable()
  445. .frame(width: 24, height: 24)
  446. .foregroundColor(.loopYellow)
  447. .padding(8)
  448. if let carbsReq = state.carbsRequired {
  449. Text(numberFormatter.string(from: carbsReq as NSNumber)!)
  450. .font(.caption)
  451. .foregroundColor(.white)
  452. .padding(4)
  453. .background(Capsule().fill(Color.red))
  454. }
  455. }
  456. }.buttonStyle(.borderless)
  457. Spacer()
  458. Button { state.showModal(for: .addTempTarget) }
  459. label: {
  460. Image("target")
  461. .renderingMode(.template)
  462. .resizable()
  463. .frame(width: 24, height: 24)
  464. .padding(8)
  465. }
  466. .foregroundColor(.loopGreen)
  467. .buttonStyle(.borderless)
  468. Spacer()
  469. Button {
  470. state.showModal(for: .bolus(
  471. waitForSuggestion: true,
  472. fetch: false
  473. ))
  474. }
  475. label: {
  476. Image("bolus")
  477. .renderingMode(.template)
  478. .resizable()
  479. .frame(width: 24, height: 24)
  480. .padding(8)
  481. }
  482. .foregroundColor(.insulin)
  483. .buttonStyle(.borderless)
  484. Spacer()
  485. if state.allowManualTemp {
  486. Button { state.showModal(for: .manualTempBasal) }
  487. label: {
  488. Image("bolus1")
  489. .renderingMode(.template)
  490. .resizable()
  491. .frame(width: 24, height: 24)
  492. .padding(8)
  493. }
  494. .foregroundColor(.insulin)
  495. .buttonStyle(.borderless)
  496. Spacer()
  497. }
  498. Button { state.showModal(for: .statistics)
  499. }
  500. label: {
  501. Image(systemName: "chart.xyaxis.line")
  502. .renderingMode(.template)
  503. .resizable()
  504. .frame(width: 24, height: 24)
  505. .padding(8)
  506. }
  507. .foregroundColor(.purple)
  508. .buttonStyle(.borderless)
  509. Spacer()
  510. Button { state.showModal(for: .settings) }
  511. label: {
  512. Image("settings1")
  513. .renderingMode(.template)
  514. .resizable()
  515. .frame(width: 24, height: 24)
  516. .padding(8)
  517. }
  518. .foregroundColor(.loopGray)
  519. .buttonStyle(.borderless)
  520. }
  521. .padding(.horizontal, 24)
  522. .padding(.bottom, geo.safeAreaInsets.bottom)
  523. }
  524. }
  525. var body: some View {
  526. GeometryReader { geo in
  527. VStack(spacing: 0) {
  528. header(geo)
  529. infoPanel
  530. mainChart
  531. legendPanel
  532. profiles(geo)
  533. bottomPanel(geo)
  534. }
  535. .edgesIgnoringSafeArea(.vertical)
  536. }
  537. .onAppear(perform: configureView)
  538. .navigationTitle("Home")
  539. .navigationBarHidden(true)
  540. .ignoresSafeArea(.keyboard)
  541. .popup(isPresented: isStatusPopupPresented, alignment: .top, direction: .top) {
  542. popup
  543. .padding()
  544. .background(
  545. RoundedRectangle(cornerRadius: 8, style: .continuous)
  546. .fill(Color(UIColor.darkGray))
  547. )
  548. .onTapGesture {
  549. isStatusPopupPresented = false
  550. }
  551. .gesture(
  552. DragGesture(minimumDistance: 10, coordinateSpace: .local)
  553. .onEnded { value in
  554. if value.translation.height < 0 {
  555. isStatusPopupPresented = false
  556. }
  557. }
  558. )
  559. }
  560. }
  561. private var popup: some View {
  562. VStack(alignment: .leading, spacing: 4) {
  563. Text(state.statusTitle).font(.headline).foregroundColor(.white)
  564. .padding(.bottom, 4)
  565. if let suggestion = state.suggestion {
  566. TagCloudView(tags: suggestion.reasonParts).animation(.none, value: false)
  567. Text(suggestion.reasonConclusion.capitalizingFirstLetter()).font(.caption).foregroundColor(.white)
  568. } else {
  569. Text("No sugestion found").font(.body).foregroundColor(.white)
  570. }
  571. if let errorMessage = state.errorMessage, let date = state.errorDate {
  572. Text(NSLocalizedString("Error at", comment: "") + " " + dateFormatter.string(from: date))
  573. .foregroundColor(.white)
  574. .font(.headline)
  575. .padding(.bottom, 4)
  576. .padding(.top, 8)
  577. Text(errorMessage).font(.caption).foregroundColor(.loopRed)
  578. } else if let suggestion = state.suggestion, (suggestion.bg ?? 100) == 400 {
  579. Text("Invalid CGM reading (HIGH).").font(.callout).bold().foregroundColor(.loopRed).padding(.top, 8)
  580. Text("SMBs and High Temps Disabled.").font(.caption).foregroundColor(.white).padding(.bottom, 4)
  581. }
  582. }
  583. }
  584. }
  585. }