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 notice to labeler card, show all labelers

+65 -71
+24 -4
src/components/LabelingServiceCard/index.tsx
··· 9 9 import {useLabelerInfoQuery} from '#/state/queries/labeler' 10 10 import {UserAvatar} from '#/view/com/util/UserAvatar' 11 11 import {atoms as a, useTheme, ViewStyleProp} from '#/alf' 12 + import {Flag_Stroke2_Corner0_Rounded as Flag} from '#/components/icons/Flag' 12 13 import {Link as InternalLink, LinkProps} from '#/components/Link' 13 14 import {RichText} from '#/components/RichText' 14 15 import {Text} from '#/components/Typography' ··· 43 44 } 44 45 45 46 export function Title({value}: {value: string}) { 46 - return <Text style={[a.text_md, a.font_bold]}>{value}</Text> 47 + return <Text style={[a.text_md, a.font_bold, a.leading_tight]}>{value}</Text> 47 48 } 48 49 49 50 export function Description({value, handle}: {value?: string; handle: string}) { 50 51 return value ? ( 51 52 <Text numberOfLines={2}> 52 - <RichText value={value} style={[]} /> 53 + <RichText value={value} style={[a.leading_snug]} /> 53 54 </Text> 54 55 ) : ( 55 - <Text> 56 + <Text style={[a.leading_snug]}> 56 57 <Trans>By {sanitizeHandle(handle, '@')}</Trans> 57 58 </Text> 58 59 ) 59 60 } 60 61 62 + export function RegionalNotice() { 63 + const t = useTheme() 64 + return ( 65 + <View 66 + style={[ 67 + a.flex_row, 68 + a.align_center, 69 + a.gap_xs, 70 + a.pt_2xs, 71 + {marginLeft: -2}, 72 + ]}> 73 + <Flag fill={t.atoms.text_contrast_low.color} size="sm" /> 74 + <Text style={[a.italic, a.leading_snug]}> 75 + <Trans>Required in your region</Trans> 76 + </Text> 77 + </View> 78 + ) 79 + } 80 + 61 81 export function LikeCount({count}: {count: number}) { 62 82 const t = useTheme() 63 83 return ( ··· 85 105 a.align_center, 86 106 a.justify_between, 87 107 ]}> 88 - <View style={[a.gap_xs, a.flex_1]}>{children}</View> 108 + <View style={[a.gap_2xs, a.flex_1]}>{children}</View> 89 109 90 110 <ChevronRight size="md" style={[a.z_10, t.atoms.text_contrast_low]} /> 91 111 </View>
+41 -67
src/screens/Moderation/index.tsx
··· 39 39 import {CircleBanSign_Stroke2_Corner0_Rounded as CircleBanSign} from '#/components/icons/CircleBanSign' 40 40 import {Props as SVGIconProps} from '#/components/icons/common' 41 41 import {Filter_Stroke2_Corner0_Rounded as Filter} from '#/components/icons/Filter' 42 - import {Flag_Stroke2_Corner0_Rounded as Flag} from '#/components/icons/Flag' 43 42 import {Group3_Stroke2_Corner0_Rounded as Group} from '#/components/icons/Group' 44 43 import {Person_Stroke2_Corner0_Rounded as Person} from '#/components/icons/Person' 45 44 import * as LabelingService from '#/components/LabelingServiceCard' ··· 425 424 </View> 426 425 ) : ( 427 426 <View style={[a.rounded_sm, t.atoms.bg_contrast_25]}> 428 - {labelers 429 - .filter( 430 - labeler => 431 - !isNonConfigurableModerationAuthority(labeler.creator.did), 427 + {labelers.map((labeler, i) => { 428 + return ( 429 + <React.Fragment key={labeler.creator.did}> 430 + {i !== 0 && <Divider />} 431 + <LabelingService.Link labeler={labeler}> 432 + {state => ( 433 + <LabelingService.Outer 434 + style={[ 435 + i === 0 && { 436 + borderTopLeftRadius: a.rounded_sm.borderRadius, 437 + borderTopRightRadius: a.rounded_sm.borderRadius, 438 + }, 439 + i === labelers.length - 1 && { 440 + borderBottomLeftRadius: a.rounded_sm.borderRadius, 441 + borderBottomRightRadius: a.rounded_sm.borderRadius, 442 + }, 443 + (state.hovered || state.pressed) && [ 444 + t.atoms.bg_contrast_50, 445 + ], 446 + ]}> 447 + <LabelingService.Avatar avatar={labeler.creator.avatar} /> 448 + <LabelingService.Content> 449 + <LabelingService.Title 450 + value={getLabelingServiceTitle({ 451 + displayName: labeler.creator.displayName, 452 + handle: labeler.creator.handle, 453 + })} 454 + /> 455 + <LabelingService.Description 456 + value={labeler.creator.description} 457 + handle={labeler.creator.handle} 458 + /> 459 + {isNonConfigurableModerationAuthority( 460 + labeler.creator.did, 461 + ) && <LabelingService.RegionalNotice />} 462 + </LabelingService.Content> 463 + </LabelingService.Outer> 464 + )} 465 + </LabelingService.Link> 466 + </React.Fragment> 432 467 ) 433 - .map((labeler, i) => { 434 - return ( 435 - <React.Fragment key={labeler.creator.did}> 436 - {i !== 0 && <Divider />} 437 - <LabelingService.Link labeler={labeler}> 438 - {state => ( 439 - <LabelingService.Outer 440 - style={[ 441 - i === 0 && { 442 - borderTopLeftRadius: a.rounded_sm.borderRadius, 443 - borderTopRightRadius: a.rounded_sm.borderRadius, 444 - }, 445 - i === labelers.length - 1 && { 446 - borderBottomLeftRadius: a.rounded_sm.borderRadius, 447 - borderBottomRightRadius: a.rounded_sm.borderRadius, 448 - }, 449 - (state.hovered || state.pressed) && [ 450 - t.atoms.bg_contrast_50, 451 - ], 452 - ]}> 453 - <LabelingService.Avatar 454 - avatar={labeler.creator.avatar} 455 - /> 456 - <LabelingService.Content> 457 - <LabelingService.Title 458 - value={getLabelingServiceTitle({ 459 - displayName: labeler.creator.displayName, 460 - handle: labeler.creator.handle, 461 - })} 462 - /> 463 - <LabelingService.Description 464 - value={labeler.creator.description} 465 - handle={labeler.creator.handle} 466 - /> 467 - </LabelingService.Content> 468 - </LabelingService.Outer> 469 - )} 470 - </LabelingService.Link> 471 - </React.Fragment> 472 - ) 473 - })} 468 + })} 474 469 </View> 475 470 )} 476 - 477 - {labelers?.some( 478 - labeler => !isNonConfigurableModerationAuthority(labeler.creator.did), 479 - ) && ( 480 - <View 481 - style={[ 482 - a.p_lg, 483 - a.mb_md, 484 - a.flex_row, 485 - a.align_center, 486 - a.justify_center, 487 - a.gap_sm, 488 - ]}> 489 - <Flag fill={t.atoms.text_contrast_low.color} size="sm" /> 490 - <Text style={[a.italic]}> 491 - <Trans>Additional moderation may apply in your region.</Trans> 492 - </Text> 493 - </View> 494 - )} 495 - 496 - <Divider /> 497 471 498 472 <Text 499 473 style={[