Set up the global 'joined this week' (#4625)

zio/stable
Paul Frazee 2024-06-24 16:03:32 -07:00 committed by GitHub
parent 9e89ddeb1c
commit ed940c637e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 19 deletions

View File

@ -13,6 +13,15 @@ export const EMBED_SERVICE = 'https://embed.bsky.app'
export const EMBED_SCRIPT = `${EMBED_SERVICE}/static/embed.js` export const EMBED_SCRIPT = `${EMBED_SERVICE}/static/embed.js`
export const BSKY_DOWNLOAD_URL = 'https://bsky.app/download' export const BSKY_DOWNLOAD_URL = 'https://bsky.app/download'
// HACK
// Yes, this is exactly what it looks like. It's a hard-coded constant
// reflecting the number of new users in the last week. We don't have
// time to add a route to the servers for this so we're just going to hard
// code and update this number with each release until we can get the
// server route done.
// -prf
export const JOINED_THIS_WEEK = 37115 // as of June24 2024
const BASE_FEEDBACK_FORM_URL = `${HELP_DESK_URL}/requests/new` const BASE_FEEDBACK_FORM_URL = `${HELP_DESK_URL}/requests/new`
export function FEEDBACK_FORM_URL({ export function FEEDBACK_FORM_URL({
email, email,

View File

@ -11,6 +11,7 @@ import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
import {msg, Trans} from '@lingui/macro' import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
import {JOINED_THIS_WEEK} from '#/lib/constants'
import {isAndroidWeb} from 'lib/browser' import {isAndroidWeb} from 'lib/browser'
import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
import {createStarterPackGooglePlayUri} from 'lib/strings/starter-pack' import {createStarterPackGooglePlayUri} from 'lib/strings/starter-pack'
@ -21,6 +22,7 @@ import {
useActiveStarterPack, useActiveStarterPack,
useSetActiveStarterPack, useSetActiveStarterPack,
} from 'state/shell/starter-pack' } from 'state/shell/starter-pack'
import {formatCount} from '#/view/com/util/numeric/format'
import {LoggedOutScreenState} from 'view/com/auth/LoggedOut' import {LoggedOutScreenState} from 'view/com/auth/LoggedOut'
import {CenteredView} from 'view/com/util/Views' import {CenteredView} from 'view/com/util/Views'
import {Logo} from 'view/icons/Logo' import {Logo} from 'view/icons/Logo'
@ -95,7 +97,7 @@ function LandingScreenLoaded({
setScreenState: (state: LoggedOutScreenState) => void setScreenState: (state: LoggedOutScreenState) => void
moderationOpts: ModerationOpts moderationOpts: ModerationOpts
}) { }) {
const {record, creator, listItemsSample, feeds, joinedWeekCount} = starterPack const {record, creator, listItemsSample, feeds} = starterPack
const {_} = useLingui() const {_} = useLingui()
const t = useTheme() const t = useTheme()
const activeStarterPack = useActiveStarterPack() const activeStarterPack = useActiveStarterPack()
@ -200,7 +202,6 @@ function LandingScreenLoaded({
<Trans>Join Bluesky</Trans> <Trans>Join Bluesky</Trans>
</ButtonText> </ButtonText>
</Button> </Button>
{joinedWeekCount && joinedWeekCount >= 25 ? (
<View style={[a.flex_row, a.align_center, a.gap_sm]}> <View style={[a.flex_row, a.align_center, a.gap_sm]}>
<FontAwesomeIcon <FontAwesomeIcon
icon="arrow-trend-up" icon="arrow-trend-up"
@ -214,10 +215,9 @@ function LandingScreenLoaded({
t.atoms.text_contrast_medium, t.atoms.text_contrast_medium,
]} ]}
numberOfLines={1}> numberOfLines={1}>
123,659 joined this week <Trans>{formatCount(JOINED_THIS_WEEK)} joined this week</Trans>
</Text> </Text>
</View> </View>
) : null}
</View> </View>
<View style={[a.gap_3xl]}> <View style={[a.gap_3xl]}>
{Boolean(listItemsSample?.length) && ( {Boolean(listItemsSample?.length) && (