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 copy to feeds page (#2852)

* move `IconCircle` to `components` for reuse

* add copy to feeds page

* start of a header

* saveit

* add lg size

* add your feeds

* don't show Your Feeds if you don't have any

* Minor ui tweaks

* cleanup

* remove unused activity indicator

---------

Co-authored-by: Paul Frazee <pfrazee@gmail.com>

authored by hailey.at

Paul Frazee and committed by
GitHub
d8245e96 36e1da10

+129 -97
+2 -2
src/screens/Onboarding/IconCircle.tsx src/components/IconCircle.tsx
··· 30 30 a.align_center, 31 31 a.rounded_full, 32 32 { 33 - width: 64, 34 - height: 64, 33 + width: size === 'lg' ? 52 : 64, 34 + height: size === 'lg' ? 52 : 64, 35 35 backgroundColor: 36 36 t.name === 'light' ? t.palette.primary_50 : t.palette.primary_950, 37 37 },
+1 -1
src/screens/Onboarding/StepAlgoFeeds/index.tsx
··· 20 20 OnboardingControls, 21 21 } from '#/screens/Onboarding/Layout' 22 22 import {FeedCard} from '#/screens/Onboarding/StepAlgoFeeds/FeedCard' 23 - import {IconCircle} from '#/screens/Onboarding/IconCircle' 23 + import {IconCircle} from '#/components/IconCircle' 24 24 25 25 export type FeedConfig = { 26 26 default: boolean
+1 -1
src/screens/Onboarding/StepFinished.tsx
··· 23 23 Description, 24 24 OnboardingControls, 25 25 } from '#/screens/Onboarding/Layout' 26 - import {IconCircle} from '#/screens/Onboarding/IconCircle' 26 + import {IconCircle} from '#/components/IconCircle' 27 27 import { 28 28 bulkWriteFollows, 29 29 sortPrimaryAlgorithmFeeds,
+1 -1
src/screens/Onboarding/StepFollowingFeed.tsx
··· 22 22 usePreferencesQuery, 23 23 useSetFeedViewPreferencesMutation, 24 24 } from 'state/queries/preferences' 25 - import {IconCircle} from '#/screens/Onboarding/IconCircle' 25 + import {IconCircle} from '#/components/IconCircle' 26 26 27 27 export function StepFollowingFeed() { 28 28 const {_} = useLingui()
+1 -1
src/screens/Onboarding/StepInterests/index.tsx
··· 26 26 OnboardingControls, 27 27 } from '#/screens/Onboarding/Layout' 28 28 import {InterestButton} from '#/screens/Onboarding/StepInterests/InterestButton' 29 - import {IconCircle} from '#/screens/Onboarding/IconCircle' 29 + import {IconCircle} from '#/components/IconCircle' 30 30 31 31 export function StepInterests() { 32 32 const {_} = useLingui()
+1 -1
src/screens/Onboarding/StepModeration/index.tsx
··· 26 26 import {ModerationOption} from '#/screens/Onboarding/StepModeration/ModerationOption' 27 27 import {AdultContentEnabledPref} from '#/screens/Onboarding/StepModeration/AdultContentEnabledPref' 28 28 import {Context} from '#/screens/Onboarding/state' 29 - import {IconCircle} from '#/screens/Onboarding/IconCircle' 29 + import {IconCircle} from '#/components/IconCircle' 30 30 31 31 function AnimatedDivider() { 32 32 return (
+1 -1
src/screens/Onboarding/StepSuggestedAccounts/index.tsx
··· 27 27 SuggestedAccountCardPlaceholder, 28 28 } from '#/screens/Onboarding/StepSuggestedAccounts/SuggestedAccountCard' 29 29 import {aggregateInterestItems} from '#/screens/Onboarding/util' 30 - import {IconCircle} from '#/screens/Onboarding/IconCircle' 30 + import {IconCircle} from '#/components/IconCircle' 31 31 32 32 export function Inner({ 33 33 profiles,
+1 -1
src/screens/Onboarding/StepTopicalFeeds.tsx
··· 21 21 } from '#/screens/Onboarding/Layout' 22 22 import {FeedCard} from '#/screens/Onboarding/StepAlgoFeeds/FeedCard' 23 23 import {aggregateInterestItems} from '#/screens/Onboarding/util' 24 - import {IconCircle} from '#/screens/Onboarding/IconCircle' 24 + import {IconCircle} from '#/components/IconCircle' 25 25 26 26 export function StepTopicalFeeds() { 27 27 const {_} = useLingui()
+120 -88
src/view/screens/Feeds.tsx
··· 16 16 import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' 17 17 import {ComposeIcon2, CogIcon, MagnifyingGlassIcon2} from 'lib/icons' 18 18 import {s} from 'lib/styles' 19 + import {atoms as a, useTheme} from '#/alf' 19 20 import {SearchInput, SearchInputRef} from 'view/com/util/forms/SearchInput' 20 21 import {UserAvatar} from 'view/com/util/UserAvatar' 21 22 import { ··· 41 42 import {cleanError} from 'lib/strings/errors' 42 43 import {useComposerControls} from '#/state/shell/composer' 43 44 import {useSession} from '#/state/session' 44 - import {isNative} from '#/platform/detection' 45 + import {isNative, isWeb} from '#/platform/detection' 45 46 import {HITSLOP_10} from 'lib/constants' 47 + import {IconCircle} from '#/components/IconCircle' 48 + import {ListSparkle_Stroke2_Corner0_Rounded} from '#/components/icons/ListSparkle' 49 + import {ListMagnifyingGlass_Stroke2_Corner0_Rounded} from '#/components/icons/ListMagnifyingGlass' 46 50 47 51 type Props = NativeStackScreenProps<FeedsTabNavigatorParams, 'Feeds'> 48 52 ··· 215 219 // pendingItems: this.rootStore.preferences.savedFeeds.length || 3, 216 220 }) 217 221 } else { 218 - if (preferences?.feeds?.saved.length === 0) { 219 - slices.push({ 220 - key: 'savedFeedNoResults', 221 - type: 'savedFeedNoResults', 222 - }) 223 - } else { 222 + if (preferences?.feeds?.saved.length !== 0) { 224 223 const {saved, pinned} = preferences.feeds 225 224 226 225 slices = slices.concat( ··· 400 399 ) { 401 400 return ( 402 401 <View style={s.p10}> 403 - <ActivityIndicator /> 402 + <ActivityIndicator size="large" /> 404 403 </View> 405 404 ) 406 405 } else if (item.type === 'savedFeedsHeader') { 407 - if (!isMobile) { 408 - return ( 409 - <View 410 - style={[ 411 - pal.view, 412 - styles.header, 413 - pal.border, 414 - { 415 - borderBottomWidth: 1, 416 - }, 417 - ]}> 418 - <Text type="title-lg" style={[pal.text, s.bold]}> 419 - <Trans>My Feeds</Trans> 420 - </Text> 421 - <View style={styles.headerBtnGroup}> 422 - <Pressable 423 - accessibilityRole="button" 424 - hitSlop={HITSLOP_10} 425 - onPress={searchInputRef.current?.focus}> 426 - <MagnifyingGlassIcon2 427 - size={22} 428 - strokeWidth={2} 429 - style={pal.icon} 430 - /> 431 - </Pressable> 432 - <Link 433 - href="/settings/saved-feeds" 434 - accessibilityLabel={_(msg`Edit My Feeds`)} 435 - accessibilityHint=""> 436 - <CogIcon strokeWidth={1.5} style={pal.icon} size={28} /> 437 - </Link> 406 + return ( 407 + <> 408 + {!isMobile && ( 409 + <View 410 + style={[ 411 + pal.view, 412 + styles.header, 413 + pal.border, 414 + { 415 + borderBottomWidth: 1, 416 + }, 417 + ]}> 418 + <Text type="title-lg" style={[pal.text, s.bold]}> 419 + <Trans>Feeds</Trans> 420 + </Text> 421 + <View style={styles.headerBtnGroup}> 422 + <Pressable 423 + accessibilityRole="button" 424 + hitSlop={HITSLOP_10} 425 + onPress={searchInputRef.current?.focus}> 426 + <MagnifyingGlassIcon2 427 + size={22} 428 + strokeWidth={2} 429 + style={pal.icon} 430 + /> 431 + </Pressable> 432 + <Link 433 + href="/settings/saved-feeds" 434 + accessibilityLabel={_(msg`Edit My Feeds`)} 435 + accessibilityHint=""> 436 + <CogIcon strokeWidth={1.5} style={pal.icon} size={28} /> 437 + </Link> 438 + </View> 438 439 </View> 439 - </View> 440 - ) 441 - } 442 - return <View /> 440 + )} 441 + {preferences?.feeds?.saved?.length !== 0 && <FeedsSavedHeader />} 442 + </> 443 + ) 443 444 } else if (item.type === 'savedFeedNoResults') { 444 445 return ( 445 446 <View ··· 457 458 } else if (item.type === 'popularFeedsHeader') { 458 459 return ( 459 460 <> 460 - <View 461 - style={[ 462 - pal.view, 463 - styles.header, 464 - { 465 - // This is first in the flatlist without a session -esb 466 - marginTop: hasSession ? 16 : 0, 467 - paddingLeft: isMobile ? 12 : undefined, 468 - paddingRight: 10, 469 - paddingBottom: isMobile ? 6 : undefined, 470 - }, 471 - ]}> 472 - <Text type="title-lg" style={[pal.text, s.bold]}> 473 - <Trans>Discover new feeds</Trans> 474 - </Text> 475 - 476 - {!isMobile && ( 477 - <SearchInput 478 - ref={searchInputRef} 479 - query={query} 480 - onChangeQuery={onChangeQuery} 481 - onPressCancelSearch={onPressCancelSearch} 482 - onSubmitQuery={onSubmitQuery} 483 - setIsInputFocused={onChangeSearchFocus} 484 - style={{flex: 1, maxWidth: 250}} 485 - /> 486 - )} 461 + <FeedsAboutHeader /> 462 + <View style={{paddingHorizontal: 12, paddingBottom: 12}}> 463 + <SearchInput 464 + ref={searchInputRef} 465 + query={query} 466 + onChangeQuery={onChangeQuery} 467 + onPressCancelSearch={onPressCancelSearch} 468 + onSubmitQuery={onSubmitQuery} 469 + setIsInputFocused={onChangeSearchFocus} 470 + /> 487 471 </View> 488 - 489 - {isMobile && ( 490 - <View style={{paddingHorizontal: 8, paddingBottom: 10}}> 491 - <SearchInput 492 - ref={searchInputRef} 493 - query={query} 494 - onChangeQuery={onChangeQuery} 495 - onPressCancelSearch={onPressCancelSearch} 496 - onSubmitQuery={onSubmitQuery} 497 - setIsInputFocused={onChangeSearchFocus} 498 - /> 499 - </View> 500 - )} 501 472 </> 502 473 ) 503 474 } else if (item.type === 'popularFeedsLoading') { ··· 529 500 return null 530 501 }, 531 502 [ 503 + isMobile, 504 + pal.view, 505 + pal.border, 506 + pal.text, 507 + pal.icon, 508 + pal.textLight, 532 509 _, 533 - hasSession, 534 - isMobile, 535 - pal, 510 + preferences?.feeds?.saved?.length, 536 511 query, 537 512 onChangeQuery, 538 513 onPressCancelSearch, 539 514 onSubmitQuery, 540 515 onChangeSearchFocus, 516 + hasSession, 541 517 ], 542 518 ) 543 519 ··· 551 527 showBorder 552 528 /> 553 529 )} 554 - 555 - {preferences ? <View /> : <ActivityIndicator />} 556 530 557 531 <List 558 532 ref={listRef} ··· 656 630 ]}> 657 631 <LoadingPlaceholder width={28} height={28} style={{borderRadius: 4}} /> 658 632 <LoadingPlaceholder width={140} height={12} /> 633 + </View> 634 + ) 635 + } 636 + 637 + function FeedsSavedHeader() { 638 + const t = useTheme() 639 + 640 + return ( 641 + <View 642 + style={[ 643 + a.flex_row, 644 + a.px_md, 645 + a.pt_2xl, 646 + a.gap_md, 647 + isWeb ? a.pb_2xl : a.pb_xl, 648 + a.border_b, 649 + t.atoms.border_contrast_low, 650 + ]}> 651 + <IconCircle icon={ListSparkle_Stroke2_Corner0_Rounded} size="lg" /> 652 + <View style={[a.flex_1, a.gap_sm]}> 653 + <Text style={[a.flex_1, a.text_2xl, a.font_bold, t.atoms.text]}> 654 + <Trans>My Feeds</Trans> 655 + </Text> 656 + <Text style={[t.atoms.text_contrast_high]}> 657 + <Trans>All the feeds you've saved, right in one place.</Trans> 658 + </Text> 659 + </View> 660 + </View> 661 + ) 662 + } 663 + 664 + function FeedsAboutHeader() { 665 + const t = useTheme() 666 + 667 + return ( 668 + <View 669 + style={[ 670 + a.flex_row, 671 + a.px_md, 672 + a.pt_2xl, 673 + a.gap_md, 674 + isWeb ? a.pb_2xl : a.pb_xl, 675 + ]}> 676 + <IconCircle 677 + icon={ListMagnifyingGlass_Stroke2_Corner0_Rounded} 678 + size="lg" 679 + /> 680 + <View style={[a.flex_1, a.gap_sm]}> 681 + <Text style={[a.flex_1, a.text_2xl, a.font_bold, t.atoms.text]}> 682 + <Trans>Discover New Feeds</Trans> 683 + </Text> 684 + <Text style={[t.atoms.text_contrast_high]}> 685 + <Trans> 686 + Custom feeds built by the community bring you new experiences and 687 + help you find the content you love. 688 + </Trans> 689 + </Text> 690 + </View> 659 691 </View> 660 692 ) 661 693 }