Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add list animations #81

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Chronos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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 = "";
Expand Down
1 change: 1 addition & 0 deletions Chronos/App/Tabs/Tokens/Row/TOTPRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
41 changes: 27 additions & 14 deletions Chronos/App/Tabs/Tokens/TokensTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ struct TokensTab: View {
.toolbar {
ToolbarContent()
}
.overlay(
.overlay {
EmptyStateView()
)
}
.sheet(isPresented: $showTokenAddSheet) {
AddTokenView()
.getSheetHeight()
Expand All @@ -102,6 +102,7 @@ struct TokensTab: View {
}
.presentationDetents([.height(self.detentHeight)])
}
.animation(.default, value: UUID())
}
}

Expand Down Expand Up @@ -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)
}
Expand Down
Loading