From c09221f8c4467a82c08a2cc2bda09f33ecaed557 Mon Sep 17 00:00:00 2001 From: Joel-David Date: Mon, 11 Nov 2024 22:36:42 +0800 Subject: [PATCH 1/2] Added list animations --- Chronos/App/Tabs/Tokens/Row/TOTPRowView.swift | 1 + Chronos/App/Tabs/Tokens/TokensTab.swift | 41 ++++++++++++------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/Chronos/App/Tabs/Tokens/Row/TOTPRowView.swift b/Chronos/App/Tabs/Tokens/Row/TOTPRowView.swift index f3b3ce6..bf8427b 100644 --- a/Chronos/App/Tabs/Tokens/Row/TOTPRowView.swift +++ b/Chronos/App/Tabs/Tokens/Row/TOTPRowView.swift @@ -51,6 +51,7 @@ struct TOTPRowView: View { ) .rotationEffect(.degrees(-90)) .frame(width: 28, height: 28) + .animation(.default, value: progress) Text(String(secsLeft)) .font(.system(size: 12)) diff --git a/Chronos/App/Tabs/Tokens/TokensTab.swift b/Chronos/App/Tabs/Tokens/TokensTab.swift index d26d17b..0db5495 100644 --- a/Chronos/App/Tabs/Tokens/TokensTab.swift +++ b/Chronos/App/Tabs/Tokens/TokensTab.swift @@ -91,9 +91,9 @@ struct TokensTab: View { .toolbar { ToolbarContent() } - .overlay( + .overlay { EmptyStateView() - ) + } .sheet(isPresented: $showTokenAddSheet) { AddTokenView() .getSheetHeight() @@ -102,6 +102,7 @@ struct TokensTab: View { } .presentationDetents([.height(self.detentHeight)]) } + .animation(.default, value: UUID()) } } @@ -134,29 +135,41 @@ struct TokensTab: View { private func EmptyStateView() -> some View { Group { - if tokenPairs.isEmpty { + if encryptedTokens.isEmpty { VStack { - Image(systemName: searchQuery.isEmpty ? "qrcode.viewfinder" : "magnifyingglass") + Image(systemName: "qrcode.viewfinder") .font(.system(size: 64)) .foregroundColor(.gray) .opacity(0.8) - Text(searchQuery.isEmpty ? "No tokens found. Add one by pressing the + icon at the top right corner or the button below." : "No results found") + Text("No tokens found. Add one by pressing the + icon at the top right corner or the button below.") .padding(.top, 4) .multilineTextAlignment(.center) .foregroundColor(.gray) .opacity(0.8) - if searchQuery.isEmpty { - Button { - showTokenAddSheet.toggle() - } label: { - Text("Add Token") - .padding(.horizontal, 4) - .bold() - } - .padding(.top, 4) + Button { + showTokenAddSheet.toggle() + } label: { + Text("Add Token") + .padding(.horizontal, 4) + .bold() } + .padding(.top, 4) + } + .padding(.horizontal, 24) + } else if tokenPairs.isEmpty && !searchQuery.isEmpty { + VStack { + Image(systemName: "magnifyingglass") + .font(.system(size: 64)) + .foregroundColor(.gray) + .opacity(0.8) + + Text("No results found") + .padding(.top, 4) + .multilineTextAlignment(.center) + .foregroundColor(.gray) + .opacity(0.8) } .padding(.horizontal, 24) } From f41daae541ec7b9e0ae91eebe59d499b299b8230 Mon Sep 17 00:00:00 2001 From: Joel-David Date: Mon, 11 Nov 2024 22:37:00 +0800 Subject: [PATCH 2/2] bump version --- Chronos.xcodeproj/project.pbxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Chronos.xcodeproj/project.pbxproj b/Chronos.xcodeproj/project.pbxproj index ade617c..5664794 100644 --- a/Chronos.xcodeproj/project.pbxproj +++ b/Chronos.xcodeproj/project.pbxproj @@ -886,7 +886,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 17.1; + MARKETING_VERSION = 17.2; PRODUCT_BUNDLE_IDENTIFIER = com.joeldavidw.ChronosDevDebug; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -932,7 +932,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 17.1; + MARKETING_VERSION = 17.2; PRODUCT_BUNDLE_IDENTIFIER = com.joeldavidw.ChronosDevRelease; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1257,7 +1257,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 17.1; + MARKETING_VERSION = 17.2; PRODUCT_BUNDLE_IDENTIFIER = com.joeldavidw.Chronos; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "";