@@ -16,6 +16,7 @@ public struct PostRowView: View {
16
16
@Environment ( \. sizeCategory) var sizeCategory
17
17
18
18
@Environment ( Router . self) var router
19
+ @Environment ( BSkyClient . self) var client
19
20
20
21
let post : PostItem
21
22
@@ -34,6 +35,7 @@ public struct PostRowView: View {
34
35
mainView
35
36
. padding ( . bottom, 18 )
36
37
}
38
+ . environment ( PostDataController ( post: post, client: client) )
37
39
. listRowSeparator ( . hidden)
38
40
. listRowInsets ( . init( top: 0 , leading: 18 , bottom: 0 , trailing: 18 ) )
39
41
}
@@ -60,12 +62,12 @@ public struct PostRowView: View {
60
62
image
61
63
. resizable ( )
62
64
. scaledToFit ( )
63
- . frame ( width: isQuote ? 16 : 32 , height: isQuote ? 16 : 32 )
65
+ . frame ( width: isQuote ? 16 : 40 , height: isQuote ? 16 : 40 )
64
66
. clipShape ( Circle ( ) )
65
67
default :
66
68
Circle ( )
67
69
. fill ( . gray. opacity ( 0.2 ) )
68
- . frame ( width: isQuote ? 16 : 32 , height: isQuote ? 16 : 32 )
70
+ . frame ( width: isQuote ? 16 : 40 , height: isQuote ? 16 : 40 )
69
71
}
70
72
}
71
73
. overlay {
@@ -79,6 +81,9 @@ public struct PostRowView: View {
79
81
lineWidth: 1 )
80
82
}
81
83
. shadow ( color: . shadowPrimary. opacity ( 0.3 ) , radius: 2 )
84
+ . onTapGesture {
85
+ router. navigateTo ( . profile( post. author) )
86
+ }
82
87
}
83
88
84
89
private var authorView : some View {
@@ -99,6 +104,9 @@ public struct PostRowView: View {
99
104
. foregroundStyle ( . secondary)
100
105
}
101
106
. lineLimit ( 1 )
107
+ . onTapGesture {
108
+ router. navigateTo ( . profile( post. author) )
109
+ }
102
110
}
103
111
104
112
@ViewBuilder
@@ -124,6 +132,7 @@ public struct PostRowView: View {
124
132
PostRowView (
125
133
post: . init(
126
134
uri: " " ,
135
+ cid: " " ,
127
136
indexedAt: Date ( ) ,
128
137
author: . init(
129
138
did: " " ,
@@ -134,13 +143,14 @@ public struct PostRowView: View {
134
143
replyCount: 10 ,
135
144
repostCount: 150 ,
136
145
likeCount: 38 ,
137
- isLiked : false ,
138
- isReposted : false ,
146
+ likeURI : nil ,
147
+ repostURI : nil ,
139
148
embed: nil ,
140
149
replyRef: nil ) )
141
150
PostRowView (
142
151
post: . init(
143
152
uri: " " ,
153
+ cid: " " ,
144
154
indexedAt: Date ( ) ,
145
155
author: . init(
146
156
did: " " ,
@@ -151,13 +161,14 @@ public struct PostRowView: View {
151
161
replyCount: 10 ,
152
162
repostCount: 150 ,
153
163
likeCount: 38 ,
154
- isLiked : true ,
155
- isReposted : false ,
164
+ likeURI : nil ,
165
+ repostURI : nil ,
156
166
embed: nil ,
157
167
replyRef: nil ) )
158
168
PostRowEmbedQuoteView (
159
169
post: . init(
160
170
uri: " " ,
171
+ cid: " " ,
161
172
indexedAt: Date ( ) ,
162
173
author: . init(
163
174
did: " " ,
@@ -168,8 +179,8 @@ public struct PostRowView: View {
168
179
replyCount: 10 ,
169
180
repostCount: 150 ,
170
181
likeCount: 38 ,
171
- isLiked : true ,
172
- isReposted : true ,
182
+ likeURI : " " ,
183
+ repostURI : " " ,
173
184
embed: nil ,
174
185
replyRef: nil ) )
175
186
}
0 commit comments