Merge remote-tracking branch 'origin/main' into hailey/explicitly-filter
This commit is contained in:
@@ -110,8 +110,8 @@ export function StepFinished() {
|
||||
|
||||
// Any starter pack feeds will be pinned _after_ the defaults
|
||||
if (starterPack && starterPack.feeds?.length) {
|
||||
feedsToSave.concat(
|
||||
starterPack.feeds.map(f => ({
|
||||
feedsToSave.push(
|
||||
...starterPack.feeds.map(f => ({
|
||||
type: 'feed',
|
||||
value: f.uri,
|
||||
pinned: true,
|
||||
|
||||
@@ -5,7 +5,7 @@ import {Trans} from '@lingui/macro'
|
||||
|
||||
import {Shadow} from '#/state/cache/types'
|
||||
import {isInvalidHandle} from 'lib/strings/handles'
|
||||
import {isAndroid} from 'platform/detection'
|
||||
import {isIOS} from 'platform/detection'
|
||||
import {atoms as a, useTheme, web} from '#/alf'
|
||||
import {NewskieDialog} from '#/components/NewskieDialog'
|
||||
import {Text} from '#/components/Typography'
|
||||
@@ -23,7 +23,7 @@ export function ProfileHeaderHandle({
|
||||
return (
|
||||
<View
|
||||
style={[a.flex_row, a.gap_xs, a.align_center]}
|
||||
pointerEvents={disableTaps ? 'none' : isAndroid ? 'box-only' : 'auto'}>
|
||||
pointerEvents={disableTaps ? 'none' : isIOS ? 'auto' : 'box-none'}>
|
||||
<NewskieDialog profile={profile} disabled={disableTaps} />
|
||||
{profile.viewer?.followedBy && !blockHide ? (
|
||||
<View style={[t.atoms.bg_contrast_25, a.rounded_xs, a.px_sm, a.py_xs]}>
|
||||
|
||||
@@ -11,6 +11,7 @@ import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||
import {msg, Trans} from '@lingui/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
|
||||
import {JOINED_THIS_WEEK} from '#/lib/constants'
|
||||
import {isAndroidWeb} from 'lib/browser'
|
||||
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
|
||||
import {createStarterPackGooglePlayUri} from 'lib/strings/starter-pack'
|
||||
@@ -21,6 +22,7 @@ import {
|
||||
useActiveStarterPack,
|
||||
useSetActiveStarterPack,
|
||||
} from 'state/shell/starter-pack'
|
||||
import {formatCount} from '#/view/com/util/numeric/format'
|
||||
import {LoggedOutScreenState} from 'view/com/auth/LoggedOut'
|
||||
import {CenteredView} from 'view/com/util/Views'
|
||||
import {Logo} from 'view/icons/Logo'
|
||||
@@ -95,7 +97,7 @@ function LandingScreenLoaded({
|
||||
setScreenState: (state: LoggedOutScreenState) => void
|
||||
moderationOpts: ModerationOpts
|
||||
}) {
|
||||
const {record, creator, listItemsSample, feeds, joinedWeekCount} = starterPack
|
||||
const {record, creator, listItemsSample, feeds} = starterPack
|
||||
const {_} = useLingui()
|
||||
const t = useTheme()
|
||||
const activeStarterPack = useActiveStarterPack()
|
||||
@@ -200,24 +202,22 @@ function LandingScreenLoaded({
|
||||
<Trans>Join Bluesky</Trans>
|
||||
</ButtonText>
|
||||
</Button>
|
||||
{joinedWeekCount && joinedWeekCount >= 25 ? (
|
||||
<View style={[a.flex_row, a.align_center, a.gap_sm]}>
|
||||
<FontAwesomeIcon
|
||||
icon="arrow-trend-up"
|
||||
size={12}
|
||||
color={t.atoms.text_contrast_medium.color}
|
||||
/>
|
||||
<Text
|
||||
style={[
|
||||
a.font_semibold,
|
||||
a.text_sm,
|
||||
t.atoms.text_contrast_medium,
|
||||
]}
|
||||
numberOfLines={1}>
|
||||
123,659 joined this week
|
||||
</Text>
|
||||
</View>
|
||||
) : null}
|
||||
<View style={[a.flex_row, a.align_center, a.gap_sm]}>
|
||||
<FontAwesomeIcon
|
||||
icon="arrow-trend-up"
|
||||
size={12}
|
||||
color={t.atoms.text_contrast_medium.color}
|
||||
/>
|
||||
<Text
|
||||
style={[
|
||||
a.font_semibold,
|
||||
a.text_sm,
|
||||
t.atoms.text_contrast_medium,
|
||||
]}
|
||||
numberOfLines={1}>
|
||||
<Trans>{formatCount(JOINED_THIS_WEEK)} joined this week</Trans>
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={[a.gap_3xl]}>
|
||||
{Boolean(listItemsSample?.length) && (
|
||||
@@ -231,18 +231,26 @@ function LandingScreenLoaded({
|
||||
</Trans>
|
||||
)}
|
||||
</Text>
|
||||
<View>
|
||||
<View
|
||||
style={
|
||||
isTabletOrDesktop && [
|
||||
a.border,
|
||||
a.rounded_md,
|
||||
t.atoms.border_contrast_low,
|
||||
]
|
||||
}>
|
||||
{starterPack.listItemsSample
|
||||
?.filter(p => !p.subject.associated?.labeler)
|
||||
.slice(0, 8)
|
||||
.map(item => (
|
||||
.map((item, i) => (
|
||||
<View
|
||||
key={item.subject.did}
|
||||
style={[
|
||||
a.py_lg,
|
||||
a.px_md,
|
||||
a.border_t,
|
||||
(!isTabletOrDesktop || i !== 0) && a.border_t,
|
||||
t.atoms.border_contrast_low,
|
||||
{pointerEvents: 'none'},
|
||||
]}>
|
||||
<ProfileCard
|
||||
profile={item.subject}
|
||||
@@ -259,13 +267,21 @@ function LandingScreenLoaded({
|
||||
<Trans>You'll stay updated with these feeds</Trans>
|
||||
</Text>
|
||||
|
||||
<View style={[{pointerEvents: 'none'}]}>
|
||||
{feeds?.map(feed => (
|
||||
<View
|
||||
style={[
|
||||
{pointerEvents: 'none'},
|
||||
isTabletOrDesktop && [
|
||||
a.border,
|
||||
a.rounded_md,
|
||||
t.atoms.border_contrast_low,
|
||||
],
|
||||
]}>
|
||||
{feeds?.map((feed, i) => (
|
||||
<View
|
||||
style={[
|
||||
a.py_lg,
|
||||
a.px_md,
|
||||
a.border_t,
|
||||
(!isTabletOrDesktop || i !== 0) && a.border_t,
|
||||
t.atoms.border_contrast_low,
|
||||
]}
|
||||
key={feed.uri}>
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
AppBskyGraphStarterpack,
|
||||
AtUri,
|
||||
ModerationOpts,
|
||||
RichText as RichTextAPI,
|
||||
} from '@atproto/api'
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||
import {msg, Trans} from '@lingui/macro'
|
||||
@@ -52,6 +53,7 @@ import {Loader} from '#/components/Loader'
|
||||
import * as Menu from '#/components/Menu'
|
||||
import * as Prompt from '#/components/Prompt'
|
||||
import {ReportDialog, useReportDialogControl} from '#/components/ReportDialog'
|
||||
import {RichText} from '#/components/RichText'
|
||||
import {FeedsList} from '#/components/StarterPack/Main/FeedsList'
|
||||
import {ProfilesList} from '#/components/StarterPack/Main/ProfilesList'
|
||||
import {QrCodeDialog} from '#/components/StarterPack/QrCodeDialog'
|
||||
@@ -280,6 +282,13 @@ function Header({
|
||||
return null
|
||||
}
|
||||
|
||||
const richText = record.description
|
||||
? new RichTextAPI({
|
||||
text: record.description,
|
||||
facets: record.descriptionFacets,
|
||||
})
|
||||
: undefined
|
||||
|
||||
return (
|
||||
<>
|
||||
<ProfileSubpageHeader
|
||||
@@ -324,12 +333,10 @@ function Header({
|
||||
/>
|
||||
</View>
|
||||
</ProfileSubpageHeader>
|
||||
{record.description || joinedAllTimeCount >= 25 ? (
|
||||
{richText || joinedAllTimeCount >= 25 ? (
|
||||
<View style={[a.px_lg, a.pt_md, a.pb_sm, a.gap_md]}>
|
||||
{record.description ? (
|
||||
<Text style={[a.text_md, a.leading_snug]}>
|
||||
{record.description}
|
||||
</Text>
|
||||
{richText ? (
|
||||
<RichText value={richText} style={[a.text_md, a.leading_snug]} />
|
||||
) : null}
|
||||
{joinedAllTimeCount >= 25 ? (
|
||||
<View style={[a.flex_row, a.align_center, a.gap_sm]}>
|
||||
|
||||
@@ -32,7 +32,7 @@ export function StepFeeds({moderationOpts}: {moderationOpts: ModerationOpts}) {
|
||||
const throttledQuery = useThrottledValue(query, 500)
|
||||
const {screenReaderEnabled} = useA11y()
|
||||
|
||||
const {data: savedFeedsAndLists, isLoading: isLoadingSavedFeeds} =
|
||||
const {data: savedFeedsAndLists, isFetchedAfterMount: isFetchedSavedFeeds} =
|
||||
useSavedFeeds()
|
||||
const savedFeeds = savedFeedsAndLists?.feeds
|
||||
.filter(f => f.type === 'feed' && f.view.uri !== DISCOVER_FEED_URI)
|
||||
@@ -46,15 +46,23 @@ export function StepFeeds({moderationOpts}: {moderationOpts: ModerationOpts}) {
|
||||
limit: 30,
|
||||
})
|
||||
const popularFeeds = popularFeedsPages?.pages.flatMap(p => p.feeds) ?? []
|
||||
const suggestedFeeds = savedFeeds.concat(
|
||||
popularFeeds.filter(f => !savedFeeds.some(sf => sf.uri === f.uri)),
|
||||
)
|
||||
|
||||
// If we have saved feeds already loaded, display them immediately
|
||||
// Then, when popular feeds have loaded we can concat them to the saved feeds
|
||||
const suggestedFeeds =
|
||||
savedFeeds || isFetchedSavedFeeds
|
||||
? popularFeeds
|
||||
? savedFeeds.concat(
|
||||
popularFeeds.filter(f => !savedFeeds.some(sf => sf.uri === f.uri)),
|
||||
)
|
||||
: savedFeeds
|
||||
: undefined
|
||||
|
||||
const {data: searchedFeeds, isFetching: isFetchingSearchedFeeds} =
|
||||
useSearchPopularFeedsQuery({q: throttledQuery})
|
||||
|
||||
const isLoading =
|
||||
isLoadingSavedFeeds || isLoadingPopularFeeds || isFetchingSearchedFeeds
|
||||
!isFetchedSavedFeeds || isLoadingPopularFeeds || isFetchingSearchedFeeds
|
||||
|
||||
const renderItem = ({
|
||||
item,
|
||||
|
||||
@@ -245,7 +245,6 @@ function WizardInner({
|
||||
editStarterPack({
|
||||
name: state.name?.trim() || getDefaultName(),
|
||||
description: state.description?.trim(),
|
||||
descriptionFacets: [],
|
||||
profiles: state.profiles,
|
||||
feeds: state.feeds,
|
||||
currentStarterPack: currentStarterPack,
|
||||
@@ -255,7 +254,6 @@ function WizardInner({
|
||||
createStarterPack({
|
||||
name: state.name?.trim() || getDefaultName(),
|
||||
description: state.description?.trim(),
|
||||
descriptionFacets: [],
|
||||
profiles: state.profiles,
|
||||
feeds: state.feeds,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user