mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[🐴] Add labels to chats (#4293)

* Add labels to chat list

* Add to convo header

* Prevent click through on PostAlert buttons

* Fix space

* Fix alignment

authored by

Eric Bailey and committed by
GitHub
2bb36948 cd3b502b

+74 -44
+64 -43
src/components/dms/MessagesListHeader.tsx
··· 22 22 import {ConvoMenu} from '#/components/dms/ConvoMenu' 23 23 import {Bell2Off_Filled_Corner0_Rounded as BellStroke} from '#/components/icons/Bell2' 24 24 import {Link} from '#/components/Link' 25 + import {PostAlerts} from '#/components/moderation/PostAlerts' 25 26 import {Text} from '#/components/Typography' 26 27 27 28 const PFP_SIZE = isWeb ? 40 : 34 ··· 58 59 t.atoms.border_contrast_low, 59 60 a.border_b, 60 61 a.flex_row, 61 - a.align_center, 62 + a.align_start, 62 63 a.gap_sm, 63 64 gtTablet ? a.pl_lg : a.pl_xl, 64 65 a.pr_lg, ··· 69 70 testID="conversationHeaderBackBtn" 70 71 onPress={onPressBack} 71 72 hitSlop={BACK_HITSLOP} 72 - style={{width: 30, height: 30}} 73 + style={{width: 30, height: 30, marginTop: isWeb ? 6 : 4}} 73 74 accessibilityRole="button" 74 75 accessibilityLabel={_(msg`Back`)} 75 76 accessibilityHint=""> ··· 152 153 ) 153 154 154 155 return ( 155 - <> 156 - <Link 157 - style={[a.flex_row, a.align_center, a.gap_md, a.flex_1, a.pr_md]} 158 - to={makeProfileLink(profile)}> 159 - <PreviewableUserAvatar 160 - size={PFP_SIZE} 161 - profile={profile} 162 - moderation={moderation.ui('avatar')} 163 - disableHoverCard={moderation.blocked} 164 - /> 165 - <View style={a.flex_1}> 166 - <Text 167 - style={[a.text_md, a.font_bold, web(a.leading_normal)]} 168 - numberOfLines={1}> 169 - {displayName} 170 - </Text> 171 - {!isDeletedAccount && ( 156 + <View style={[a.flex_1]}> 157 + <View style={[a.w_full, a.flex_row, a.align_center, a.justify_between]}> 158 + <Link 159 + style={[a.flex_row, a.align_start, a.gap_md, a.flex_1, a.pr_md]} 160 + to={makeProfileLink(profile)}> 161 + <View style={[a.pt_2xs]}> 162 + <PreviewableUserAvatar 163 + size={PFP_SIZE} 164 + profile={profile} 165 + moderation={moderation.ui('avatar')} 166 + disableHoverCard={moderation.blocked} 167 + /> 168 + </View> 169 + <View style={a.flex_1}> 172 170 <Text 173 - style={[ 174 - t.atoms.text_contrast_medium, 175 - a.text_sm, 176 - web([a.leading_normal, {marginTop: -2}]), 177 - ]} 171 + style={[a.text_md, a.font_bold, web(a.leading_normal)]} 178 172 numberOfLines={1}> 179 - @{profile.handle} 180 - {convoState.convo?.muted && ( 181 - <> 182 - {' '} 183 - &middot;{' '} 184 - <BellStroke size="xs" style={t.atoms.text_contrast_medium} /> 185 - </> 186 - )} 173 + {displayName} 187 174 </Text> 188 - )} 189 - </View> 190 - </Link> 175 + {!isDeletedAccount && ( 176 + <Text 177 + style={[ 178 + t.atoms.text_contrast_medium, 179 + a.text_sm, 180 + web([a.leading_normal, {marginTop: -2}]), 181 + ]} 182 + numberOfLines={1}> 183 + @{profile.handle} 184 + {convoState.convo?.muted && ( 185 + <> 186 + {' '} 187 + &middot;{' '} 188 + <BellStroke 189 + size="xs" 190 + style={t.atoms.text_contrast_medium} 191 + /> 192 + </> 193 + )} 194 + </Text> 195 + )} 196 + </View> 197 + </Link> 198 + 199 + {isConvoActive(convoState) && ( 200 + <ConvoMenu 201 + convo={convoState.convo} 202 + profile={profile} 203 + currentScreen="conversation" 204 + blockInfo={blockInfo} 205 + /> 206 + )} 207 + </View> 191 208 192 - {isConvoActive(convoState) && ( 193 - <ConvoMenu 194 - convo={convoState.convo} 195 - profile={profile} 196 - currentScreen="conversation" 197 - blockInfo={blockInfo} 209 + <View 210 + style={[ 211 + { 212 + paddingLeft: PFP_SIZE + a.gap_md.gap, 213 + }, 214 + ]}> 215 + <PostAlerts 216 + modui={moderation.ui('contentList')} 217 + size="large" 218 + style={[a.pt_xs]} 198 219 /> 199 - )} 200 - </> 220 + </View> 221 + </View> 201 222 ) 202 223 }
+3 -1
src/components/moderation/PostAlerts.tsx
··· 64 64 <> 65 65 <Button 66 66 label={desc.name} 67 - onPress={() => { 67 + onPress={e => { 68 + e.preventDefault() 69 + e.stopPropagation() 68 70 control.open() 69 71 }}> 70 72 {({hovered, pressed}) => (
+7
src/screens/Messages/List/ChatListItem.tsx
··· 23 23 import {Bell2Off_Filled_Corner0_Rounded as BellStroke} from '#/components/icons/Bell2' 24 24 import {Link} from '#/components/Link' 25 25 import {useMenuControl} from '#/components/Menu' 26 + import {PostAlerts} from '#/components/moderation/PostAlerts' 26 27 import {Text} from '#/components/Typography' 27 28 28 29 export let ChatListItem = ({ ··· 264 265 ]}> 265 266 {lastMessage} 266 267 </Text> 268 + 269 + <PostAlerts 270 + modui={moderation.ui('contentList')} 271 + size="large" 272 + style={[a.pt_xs]} 273 + /> 267 274 </View> 268 275 269 276 {convo.unreadCount > 0 && (