Skip to content
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
2 changes: 2 additions & 0 deletions Bitkit/AppScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct AppScene: View {
@StateObject private var activity = ActivityListViewModel()
@StateObject private var transfer = TransferViewModel()
@StateObject private var widgets = WidgetsViewModel()
@StateObject private var scannerManager = ScannerManager()
@StateObject private var settings = SettingsViewModel()
@StateObject private var suggestionsManager = SuggestionsManager()
@StateObject private var tagManager = TagManager()
Expand Down Expand Up @@ -70,6 +71,7 @@ struct AppScene: View {
.environmentObject(activity)
.environmentObject(transfer)
.environmentObject(widgets)
.environmentObject(scannerManager)
.environmentObject(settings)
.environmentObject(suggestionsManager)
.environmentObject(tagManager)
Expand Down
Binary file modified Bitkit/Assets.xcassets/icons/arrow-cjit.imageset/arrow-cjit.pdf
Binary file not shown.
12 changes: 0 additions & 12 deletions Bitkit/Assets.xcassets/icons/scan-brand.imageset/Contents.json

This file was deleted.

Binary file not shown.
10 changes: 1 addition & 9 deletions Bitkit/Components/Activity/ActivityList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,8 @@ struct ActivityList: View {
NavigationLink(value: Route.activityDetail(item)) {
ActivityRow(item: item)
}
.padding(.vertical)
.padding(.top)
.disabled(isHorizontalSwipe)

// Add divider if not the last item in the group
if let nextIndex = activity.groupedActivities.firstIndex(of: groupItem),
nextIndex + 1 < activity.groupedActivities.count,
case .activity = activity.groupedActivities[nextIndex + 1]
{
Divider()
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ struct CustomButton: View {
case .large: return 16
}
}

var cornerRadius: CGFloat {
switch self {
case .small: return 30
case .large: return 64
}
}
}

enum Variant {
Expand Down
12 changes: 2 additions & 10 deletions Bitkit/Components/Button/PrimaryButtonView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct PrimaryButtonView: View {
.frame(height: size.height)
.padding(.horizontal, size.horizontalPadding)
.background(backgroundGradient)
.cornerRadius(size.cornerRadius)
.cornerRadius(64)
.shadow(color: shadowColor, radius: 0, x: 0, y: -1)
.opacity(isDisabled ? 0.3 : 1.0)
.contentShape(Rectangle())
Expand All @@ -45,15 +45,7 @@ struct PrimaryButtonView: View {
return AnyView(Color.gray4)
}

let colors: [Color] = if isPressed {
[Color(hex: 0x3A3A3A), Color(hex: 0x2A2A2A)]
} else {
[Color(hex: 0x2A2A2A), Color(hex: 0x1C1C1C)]
}

return AnyView(
LinearGradient(colors: colors, startPoint: .top, endPoint: .bottom)
)
return AnyView(ButtonGradient(isPressed: isPressed))
}

private var shadowColor: Color {
Expand Down
44 changes: 26 additions & 18 deletions Bitkit/Components/Button/SecondaryButtonView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,45 @@ struct SecondaryButtonView: View {
}

if size == .small {
CaptionBText(title, textColor: foregroundColor)
CaptionBText(title, textColor: textColor)
} else {
BodySSBText(title, textColor: foregroundColor)
BodySSBText(title, textColor: textColor)
}
}
.frame(maxWidth: .infinity)
.frame(height: size.height)
.padding(.horizontal, size.horizontalPadding)
.frame(maxWidth: size == .large ? .infinity : nil)
.frame(height: buttonHeight)
.padding(.horizontal, 16)
// TODO: Add background blur
.background(
RoundedRectangle(cornerRadius: size.cornerRadius)
RoundedRectangle(cornerRadius: 64)
.fill(isPressed ? Color.white10 : Color.white01)
)
.overlay(
RoundedRectangle(cornerRadius: size.cornerRadius)
.stroke(borderColor, lineWidth: 2)
.overlay(
RoundedRectangle(cornerRadius: 64)
.strokeBorder(borderColor, lineWidth: strokeWidth)
)
)
.contentShape(Rectangle())
}

private var foregroundColor: Color {
if isDisabled {
return .white32
}
return .white80
private var textColor: Color {
return isDisabled ? .white32 : .white80
}

private var borderColor: Color {
if isDisabled {
return .clear
return isDisabled ? .clear : Color(hex: 0x3A3A3A)
}

private var buttonHeight: CGFloat {
switch size {
case .small: return 37
case .large: return 56
}
}

private var strokeWidth: CGFloat {
switch size {
case .small: return 1
case .large: return 2
}
return Color(hex: 0x3A3A3A)
}
}
5 changes: 2 additions & 3 deletions Bitkit/Components/Button/TertiaryButtonView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ struct TertiaryButtonView: View {
icon
}

BodySSBText(title, textColor: foregroundColor)
BodySSBText(title, textColor: textColor)
}
.frame(maxWidth: .infinity)
.frame(height: CustomButton.Size.large.height)
.padding(.horizontal, CustomButton.Size.large.horizontalPadding)
.background(.clear)
.cornerRadius(CustomButton.Size.large.cornerRadius)
.contentShape(Rectangle())
}

private var foregroundColor: Color {
private var textColor: Color {
return isPressed ? .textPrimary : .white80
}
}
25 changes: 12 additions & 13 deletions Bitkit/Components/CopyAddressCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct CopyAddressPair {

struct CopyAddressCard: View {
let addresses: [CopyAddressPair]
@Binding var navigationPath: [ReceiveRoute]
@State private var showTooltipForIndex: Int? = nil

var body: some View {
Expand All @@ -25,11 +26,20 @@ struct CopyAddressCard: View {
CaptionMText(pair.title)
.padding(.bottom, 12)

BodySSBText(pair.address)
BodySText(pair.address, textColor: .textPrimary)
.lineLimit(2)
.padding(.bottom, 12)

HStack(spacing: 8) {
CustomButton(
title: t("common__edit"),
size: .small,
icon: Image("pencil").foregroundColor(pair.type == .lightning ? .purpleAccent : .brandAccent),
shouldExpand: true
) {
navigationPath.append(.edit)
}

CustomButton(
title: t("common__copy"),
size: .small,
Expand Down Expand Up @@ -68,7 +78,7 @@ struct CopyAddressCard: View {
}
.frame(maxWidth: .infinity, alignment: .leading)
.padding(32)
.background(Color.white06)
.background(Color.black)
.cornerRadius(8)
.aspectRatio(1, contentMode: .fit)
}
Expand All @@ -90,14 +100,3 @@ struct CopyAddressCard: View {
}
}
}

#Preview {
CopyAddressCard(addresses: [
CopyAddressPair(title: "On-chain Address", address: "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq", type: .onchain),
CopyAddressPair(
title: "Lightning Invoice", address: "lnbc1500n1p3hk3sppp5k54t9c4p4u4tdgj0y8tqjp3kzjak8jtr0fwvnl2dpl5pvrm9gxsdqqcqzpgxqyz5vqsp5",
type: .lightning
),
])
.preferredColorScheme(.dark)
}
9 changes: 3 additions & 6 deletions Bitkit/Components/EmptyStateView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ struct EmptyStateView: View {
Spacer()

HStack(alignment: .bottom, spacing: 0) {
DisplayText(
t(type.localizationKey),
accentColor: type.accentColor
)
.frame(width: 224)
DisplayText(t(type.localizationKey), accentColor: type.accentColor)
.frame(width: 224)

Image("empty-state-arrow")
.resizable()
Expand All @@ -49,7 +46,7 @@ struct EmptyStateView: View {
Spacer()
}
.frame(maxWidth: .infinity)
.padding(.bottom, 115)
.padding(.bottom, 100)
.overlay {
if let onClose {
VStack {
Expand Down
4 changes: 1 addition & 3 deletions Bitkit/Components/Home/Widgets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ struct Widgets: View {
}
}

CustomButton(
title: t("widgets__add"), variant: .tertiary, icon: Image("plus")
) {
CustomButton(title: t("widgets__add"), variant: .tertiary) {
if app.hasSeenWidgetsIntro {
navigation.navigate(.widgetsList)
} else {
Expand Down
6 changes: 4 additions & 2 deletions Bitkit/Components/IconButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ private struct IconButtonStyle: ButtonStyle {

struct IconButton<Icon: View>: View {
let icon: Icon
let backgroundColor: Color
let size: CGFloat
let action: () -> Void

@State private var isPressed = false

init(icon: Icon, size: CGFloat = 48, action: @escaping () -> Void) {
init(icon: Icon, backgroundColor: Color = .white16, size: CGFloat = 48, action: @escaping () -> Void) {
self.icon = icon
self.backgroundColor = backgroundColor
self.size = size
self.action = action
}
Expand All @@ -29,7 +31,7 @@ struct IconButton<Icon: View>: View {
icon
}
.frame(width: size, height: size)
.background(isPressed ? Color.white32 : Color.white16)
.background(isPressed ? Color.white32 : backgroundColor)
.cornerRadius(size / 2)
.contentShape(Rectangle())
.buttonStyle(
Expand Down
4 changes: 2 additions & 2 deletions Bitkit/Components/LightningChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct LightningChannel: View {
private var spendingColor: Color {
switch status {
case .closed:
return Color.gray5
return Color.gray6
default:
return Color.purple50
}
Expand All @@ -48,7 +48,7 @@ struct LightningChannel: View {
private var receivingColor: Color {
switch status {
case .closed:
return Color.gray5
return Color.gray6
default:
return Color.white64
}
Expand Down
21 changes: 20 additions & 1 deletion Bitkit/Components/NumberPadActionButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ struct NumberPadActionButton: View {
var disabled: Bool = false
var action: () -> Void

@State private var isPressed = false

var body: some View {
Button {
Haptics.play(.buttonTap)
Expand All @@ -31,14 +33,31 @@ struct NumberPadActionButton: View {
}
.frame(height: 28)
.padding(.horizontal, 8)
.background(variant == .primary ? Color.white10 : Color.clear)
.background(background)
.overlay(
RoundedRectangle(cornerRadius: 8)
.stroke(variant == .secondary ? color : Color.clear, lineWidth: 2)
)
.cornerRadius(8)
}
.disabled(disabled)
.buttonStyle(NoAnimationButtonStyle())
.pressEvents(
onPress: {
isPressed = true
},
onRelease: {
isPressed = false
}
)
}

private var background: some View {
if variant == .secondary {
return AnyView(Color.clear)
}

return AnyView(ButtonGradient(isPressed: isPressed))
}
}

Expand Down
Loading
Loading