@@ -106,78 +106,67 @@ export default function FeedHeader(props: Props) {
106
106
}
107
107
} ;
108
108
109
+ if ( isFetchingFeedInfo || ! feedInfo ) return < FeedHeaderSkeleton /> ;
110
+
109
111
return (
110
- < >
111
- { isFetchingFeedInfo && < FeedHeaderSkeleton /> }
112
- { ! isFetchingFeedInfo && feedInfo && (
113
- < >
114
- < article className = "border-skin-base flex flex-col gap-2 border border-x-0 border-t-0 p-3 md:rounded-t-2xl md:border" >
115
- < div className = "flex flex-wrap items-center justify-between gap-3" >
116
- < div className = "flex flex-wrap items-center gap-3" >
117
- < Image
118
- src = { feedInfo . view . avatar ?? FallbackFeed }
119
- alt = { feedInfo . view . displayName }
120
- width = { 60 }
121
- height = { 60 }
122
- className = { `rounded-lg ${ ! feedInfo . view . avatar && "border-skin-base bg-skin-muted border" } ` }
123
- />
124
- < div className = "flex flex-col" >
125
- < h2 className = "text-skin-base break-words text-xl font-semibold" >
126
- { feedInfo . view . displayName }
127
- </ h2 >
128
- < h3 className = "text-skin-secondary break-all" >
129
- By{ " " }
130
- < Link
131
- href = { `/dashboard/user/${ feedInfo . view . creator . handle } ` }
132
- className = "hover:text-skin-tertiary font-medium"
133
- >
134
- @{ feedInfo . view . creator . handle }
135
- </ Link >
136
- </ h3 >
137
- </ div >
138
- </ div >
139
- { isSaved !== null && isPinned !== null && (
140
- < div className = "flex flex-wrap gap-3" >
141
- < Button onClick = { toggleSave } >
142
- { isSaved && (
143
- < BiSolidTrash className = "text-status-danger text-lg" />
144
- ) }
145
- { ! isSaved && (
146
- < BiPlus className = "text-skin-icon-base text-lg" />
147
- ) }
148
- </ Button >
149
- < Button onClick = { togglePin } >
150
- < BiSolidBookmarkAlt
151
- className = { `text-lg ${
152
- isPinned
153
- ? "text-status-success"
154
- : "text-skin-icon-muted"
155
- } `}
156
- />
157
- </ Button >
158
- < Button onClick = { toggleLike } >
159
- { likeUri && (
160
- < BiSolidHeart className = "text-skin-icon-like text-lg" />
161
- ) }
162
- { ! likeUri && (
163
- < BiHeart className = "text-skin-icon-muted text-lg" />
164
- ) }
165
- </ Button >
166
- </ div >
112
+ < article className = "border-skin-base flex flex-col gap-2 border border-x-0 border-t-0 p-3 md:rounded-t-2xl md:border" >
113
+ < div className = "flex flex-wrap items-center justify-between gap-3" >
114
+ < div className = "flex flex-wrap items-center gap-3" >
115
+ < Image
116
+ src = { feedInfo . view . avatar ?? FallbackFeed }
117
+ alt = { feedInfo . view . displayName }
118
+ width = { 60 }
119
+ height = { 60 }
120
+ className = { `rounded-lg ${ ! feedInfo . view . avatar && "border-skin-base bg-skin-muted border" } ` }
121
+ />
122
+ < div className = "flex flex-col" >
123
+ < h2 className = "text-skin-base break-words text-xl font-semibold" >
124
+ { feedInfo . view . displayName }
125
+ </ h2 >
126
+ < h3 className = "text-skin-secondary break-all" >
127
+ By{ " " }
128
+ < Link
129
+ href = { `/dashboard/user/${ feedInfo . view . creator . handle } ` }
130
+ className = "hover:text-skin-tertiary font-medium"
131
+ >
132
+ @{ feedInfo . view . creator . handle }
133
+ </ Link >
134
+ </ h3 >
135
+ </ div >
136
+ </ div >
137
+ { isSaved !== null && isPinned !== null && (
138
+ < div className = "flex flex-wrap gap-3" >
139
+ < Button onClick = { toggleSave } >
140
+ { isSaved && (
141
+ < BiSolidTrash className = "text-status-danger text-lg" />
142
+ ) }
143
+ { ! isSaved && < BiPlus className = "text-skin-icon-base text-lg" /> }
144
+ </ Button >
145
+ < Button onClick = { togglePin } >
146
+ < BiSolidBookmarkAlt
147
+ className = { `text-lg ${
148
+ isPinned ? "text-status-success" : "text-skin-icon-muted"
149
+ } `}
150
+ />
151
+ </ Button >
152
+ < Button onClick = { toggleLike } >
153
+ { likeUri && (
154
+ < BiSolidHeart className = "text-skin-icon-like text-lg" />
167
155
) }
168
- </ div >
169
- { feedInfo . view . description && (
170
- < p className = "text-skin-base break-words" dir = "auto" >
171
- { feedInfo . view . description }
172
- </ p >
173
- ) }
174
- < small className = "text-skin-secondary flex items-center gap-1 font-medium" >
175
- < BiSolidHeart className = "text-skin-icon-base" />
176
- < span > { feedInfo . view . likeCount } </ span >
177
- </ small >
178
- </ article >
179
- </ >
156
+ { ! likeUri && < BiHeart className = "text-skin-icon-muted text-lg" /> }
157
+ </ Button >
158
+ </ div >
159
+ ) }
160
+ </ div >
161
+ { feedInfo . view . description && (
162
+ < p className = "text-skin-base break-words" dir = "auto" >
163
+ { feedInfo . view . description }
164
+ </ p >
180
165
) }
181
- </ >
166
+ < small className = "text-skin-secondary flex items-center gap-1 font-medium" >
167
+ < BiSolidHeart className = "text-skin-icon-base" />
168
+ < span > { feedInfo . view . likeCount } </ span >
169
+ </ small >
170
+ </ article >
182
171
) ;
183
172
}
0 commit comments