Skip to content

Commit 7bb8d66

Browse files
committed
feat(home): rework home screen with tabs
1 parent 08aeae3 commit 7bb8d66

44 files changed

Lines changed: 964 additions & 774 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "trezor-card.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
64.5 KB
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "arrow-widgets.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "suggestions-widget.pdf",
5+
"idiom" : "universal"
6+
}
7+
],
8+
"info" : {
9+
"author" : "xcode",
10+
"version" : 1
11+
}
12+
}
Binary file not shown.

Bitkit/Components/Core/ButtonDetectionModifier.swift

Lines changed: 0 additions & 47 deletions
This file was deleted.

Bitkit/Components/Core/ButtonLocationTracking.swift

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import SwiftUI
2+
3+
/// Preference key for tracking drag handle location in a coordinate space.
4+
/// Used so only the drag handle (e.g. burger icon) starts a reorder drag.
5+
struct DragHandlePreferenceKey: PreferenceKey {
6+
static var defaultValue: [CGRect] = []
7+
static func reduce(value: inout [CGRect], nextValue: () -> [CGRect]) {
8+
value.append(contentsOf: nextValue())
9+
}
10+
}
11+
12+
private struct DragHandleLocationModifier: ViewModifier {
13+
let coordinateSpace: String
14+
15+
func body(content: Content) -> some View {
16+
content
17+
.background(
18+
GeometryReader { geometry in
19+
Color.clear
20+
.preference(
21+
key: DragHandlePreferenceKey.self,
22+
value: [geometry.frame(in: .named(coordinateSpace))]
23+
)
24+
}
25+
)
26+
}
27+
}
28+
29+
public extension View {
30+
/// Reports this view's frame as the drag handle in the given coordinate space.
31+
/// Only touches that start inside this frame will begin a reorder drag.
32+
func trackDragHandle(in coordinateSpace: String = "dragSpace") -> some View {
33+
modifier(DragHandleLocationModifier(coordinateSpace: coordinateSpace))
34+
}
35+
}

0 commit comments

Comments
 (0)