Skip to content

Commit dedb28b

Browse files
authored
feat(ui): design prototype v58 (#150)
1 parent bd3a6ba commit dedb28b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1088
-1045
lines changed

Bitkit/AppScene.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ struct AppScene: View {
1414
@StateObject private var activity = ActivityListViewModel()
1515
@StateObject private var transfer = TransferViewModel()
1616
@StateObject private var widgets = WidgetsViewModel()
17+
@StateObject private var scannerManager = ScannerManager()
1718
@StateObject private var settings = SettingsViewModel()
1819
@StateObject private var suggestionsManager = SuggestionsManager()
1920
@StateObject private var tagManager = TagManager()
@@ -70,6 +71,7 @@ struct AppScene: View {
7071
.environmentObject(activity)
7172
.environmentObject(transfer)
7273
.environmentObject(widgets)
74+
.environmentObject(scannerManager)
7375
.environmentObject(settings)
7476
.environmentObject(suggestionsManager)
7577
.environmentObject(tagManager)
1.43 KB
Binary file not shown.

Bitkit/Assets.xcassets/icons/scan-brand.imageset/Contents.json

Lines changed: 0 additions & 12 deletions
This file was deleted.
-3.78 KB
Binary file not shown.

Bitkit/Components/Activity/ActivityList.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,8 @@ struct ActivityList: View {
2929
NavigationLink(value: Route.activityDetail(item)) {
3030
ActivityRow(item: item)
3131
}
32-
.padding(.vertical)
32+
.padding(.top)
3333
.disabled(isHorizontalSwipe)
34-
35-
// Add divider if not the last item in the group
36-
if let nextIndex = activity.groupedActivities.firstIndex(of: groupItem),
37-
nextIndex + 1 < activity.groupedActivities.count,
38-
case .activity = activity.groupedActivities[nextIndex + 1]
39-
{
40-
Divider()
41-
}
4234
}
4335
}
4436
}
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@ struct CustomButton: View {
5656
case .large: return 16
5757
}
5858
}
59-
60-
var cornerRadius: CGFloat {
61-
switch self {
62-
case .small: return 30
63-
case .large: return 64
64-
}
65-
}
6659
}
6760

6861
enum Variant {

Bitkit/Components/Button/PrimaryButtonView.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct PrimaryButtonView: View {
3131
.frame(height: size.height)
3232
.padding(.horizontal, size.horizontalPadding)
3333
.background(backgroundGradient)
34-
.cornerRadius(size.cornerRadius)
34+
.cornerRadius(64)
3535
.shadow(color: shadowColor, radius: 0, x: 0, y: -1)
3636
.opacity(isDisabled ? 0.3 : 1.0)
3737
.contentShape(Rectangle())
@@ -45,15 +45,7 @@ struct PrimaryButtonView: View {
4545
return AnyView(Color.gray4)
4646
}
4747

48-
let colors: [Color] = if isPressed {
49-
[Color(hex: 0x3A3A3A), Color(hex: 0x2A2A2A)]
50-
} else {
51-
[Color(hex: 0x2A2A2A), Color(hex: 0x1C1C1C)]
52-
}
53-
54-
return AnyView(
55-
LinearGradient(colors: colors, startPoint: .top, endPoint: .bottom)
56-
)
48+
return AnyView(ButtonGradient(isPressed: isPressed))
5749
}
5850

5951
private var shadowColor: Color {

Bitkit/Components/Button/SecondaryButtonView.swift

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,45 @@ struct SecondaryButtonView: View {
1414
}
1515

1616
if size == .small {
17-
CaptionBText(title, textColor: foregroundColor)
17+
CaptionBText(title, textColor: textColor)
1818
} else {
19-
BodySSBText(title, textColor: foregroundColor)
19+
BodySSBText(title, textColor: textColor)
2020
}
2121
}
22-
.frame(maxWidth: .infinity)
23-
.frame(height: size.height)
24-
.padding(.horizontal, size.horizontalPadding)
22+
.frame(maxWidth: size == .large ? .infinity : nil)
23+
.frame(height: buttonHeight)
24+
.padding(.horizontal, 16)
2525
// TODO: Add background blur
2626
.background(
27-
RoundedRectangle(cornerRadius: size.cornerRadius)
27+
RoundedRectangle(cornerRadius: 64)
2828
.fill(isPressed ? Color.white10 : Color.white01)
29-
)
30-
.overlay(
31-
RoundedRectangle(cornerRadius: size.cornerRadius)
32-
.stroke(borderColor, lineWidth: 2)
29+
.overlay(
30+
RoundedRectangle(cornerRadius: 64)
31+
.strokeBorder(borderColor, lineWidth: strokeWidth)
32+
)
3333
)
3434
.contentShape(Rectangle())
3535
}
3636

37-
private var foregroundColor: Color {
38-
if isDisabled {
39-
return .white32
40-
}
41-
return .white80
37+
private var textColor: Color {
38+
return isDisabled ? .white32 : .white80
4239
}
4340

4441
private var borderColor: Color {
45-
if isDisabled {
46-
return .clear
42+
return isDisabled ? .clear : Color(hex: 0x3A3A3A)
43+
}
44+
45+
private var buttonHeight: CGFloat {
46+
switch size {
47+
case .small: return 37
48+
case .large: return 56
49+
}
50+
}
51+
52+
private var strokeWidth: CGFloat {
53+
switch size {
54+
case .small: return 1
55+
case .large: return 2
4756
}
48-
return Color(hex: 0x3A3A3A)
4957
}
5058
}

Bitkit/Components/Button/TertiaryButtonView.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@ struct TertiaryButtonView: View {
1111
icon
1212
}
1313

14-
BodySSBText(title, textColor: foregroundColor)
14+
BodySSBText(title, textColor: textColor)
1515
}
1616
.frame(maxWidth: .infinity)
1717
.frame(height: CustomButton.Size.large.height)
1818
.padding(.horizontal, CustomButton.Size.large.horizontalPadding)
1919
.background(.clear)
20-
.cornerRadius(CustomButton.Size.large.cornerRadius)
2120
.contentShape(Rectangle())
2221
}
2322

24-
private var foregroundColor: Color {
23+
private var textColor: Color {
2524
return isPressed ? .textPrimary : .white80
2625
}
2726
}

Bitkit/Components/CopyAddressCard.swift

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ struct CopyAddressPair {
1313

1414
struct CopyAddressCard: View {
1515
let addresses: [CopyAddressPair]
16+
@Binding var navigationPath: [ReceiveRoute]
1617
@State private var showTooltipForIndex: Int? = nil
1718

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

28-
BodySSBText(pair.address)
29+
BodySText(pair.address, textColor: .textPrimary)
2930
.lineLimit(2)
3031
.padding(.bottom, 12)
3132

3233
HStack(spacing: 8) {
34+
CustomButton(
35+
title: t("common__edit"),
36+
size: .small,
37+
icon: Image("pencil").foregroundColor(pair.type == .lightning ? .purpleAccent : .brandAccent),
38+
shouldExpand: true
39+
) {
40+
navigationPath.append(.edit)
41+
}
42+
3343
CustomButton(
3444
title: t("common__copy"),
3545
size: .small,
@@ -68,7 +78,7 @@ struct CopyAddressCard: View {
6878
}
6979
.frame(maxWidth: .infinity, alignment: .leading)
7080
.padding(32)
71-
.background(Color.white06)
81+
.background(Color.black)
7282
.cornerRadius(8)
7383
.aspectRatio(1, contentMode: .fit)
7484
}
@@ -90,14 +100,3 @@ struct CopyAddressCard: View {
90100
}
91101
}
92102
}
93-
94-
#Preview {
95-
CopyAddressCard(addresses: [
96-
CopyAddressPair(title: "On-chain Address", address: "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq", type: .onchain),
97-
CopyAddressPair(
98-
title: "Lightning Invoice", address: "lnbc1500n1p3hk3sppp5k54t9c4p4u4tdgj0y8tqjp3kzjak8jtr0fwvnl2dpl5pvrm9gxsdqqcqzpgxqyz5vqsp5",
99-
type: .lightning
100-
),
101-
])
102-
.preferredColorScheme(.dark)
103-
}

0 commit comments

Comments
 (0)