move hardcoded website urls to constants
This commit is contained in:
@@ -4,6 +4,7 @@ import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {Trans} from '@lingui/react/macro'
|
||||
|
||||
import {urls} from '#/lib/constants'
|
||||
import {useA11y} from '#/state/a11y'
|
||||
import {atoms as a, useTheme} from '#/alf'
|
||||
import {Button, ButtonText} from '#/components/Button'
|
||||
@@ -27,27 +28,27 @@ export function Content({state}: {state: PolicyUpdateState}) {
|
||||
const links = {
|
||||
terms: {
|
||||
overridePresentation: false,
|
||||
to: `https://bsky.social/about/support/tos`,
|
||||
to: urls.website.support.tos,
|
||||
label: _(msg`Terms of Service`),
|
||||
},
|
||||
privacy: {
|
||||
overridePresentation: false,
|
||||
to: `https://bsky.social/about/support/privacy-policy`,
|
||||
to: urls.website.support.privacy,
|
||||
label: _(msg`Privacy Policy`),
|
||||
},
|
||||
copyright: {
|
||||
overridePresentation: false,
|
||||
to: `https://bsky.social/about/support/copyright`,
|
||||
to: urls.website.support.copyright,
|
||||
label: _(msg`Copyright Policy`),
|
||||
},
|
||||
guidelines: {
|
||||
overridePresentation: false,
|
||||
to: `https://bsky.social/about/support/community-guidelines`,
|
||||
to: urls.website.support.community,
|
||||
label: _(msg`Community Guidelines`),
|
||||
},
|
||||
blog: {
|
||||
overridePresentation: false,
|
||||
to: `https://bsky.social/about/blog/08-14-2025-updated-terms-and-policies`,
|
||||
to: urls.website.blog.updatedTermsAndPolicies,
|
||||
label: _(msg`Our blog post`),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {Trans} from '@lingui/react/macro'
|
||||
|
||||
import {urls} from '#/lib/constants'
|
||||
import {useCleanError} from '#/lib/hooks/useCleanError'
|
||||
import {isAppPassword} from '#/lib/jwt'
|
||||
import {getAge, getDateAgo} from '#/lib/strings/time'
|
||||
@@ -177,7 +178,7 @@ function BirthdayInner({
|
||||
<Trans>
|
||||
You must be at least 13 years old to use Bluesky. Read our{' '}
|
||||
<SimpleInlineLinkText
|
||||
to="https://bsky.social/about/support/tos"
|
||||
to={urls.website.support.tos}
|
||||
label={_(msg`Terms of Service`)}>
|
||||
Terms of Service
|
||||
</SimpleInlineLinkText>{' '}
|
||||
|
||||
@@ -3,10 +3,11 @@ import {
|
||||
ToolsOzoneReportDefs as OzoneReportDefs,
|
||||
} from '@atproto/api'
|
||||
|
||||
import {urls} from '#/lib/constants'
|
||||
import {type ParsedReportSubject} from '#/components/moderation/ReportDialog/types'
|
||||
|
||||
export const DMCA_LINK = 'https://bsky.social/about/support/copyright'
|
||||
export const SUPPORT_PAGE = 'https://bsky.social/about/support'
|
||||
export const DMCA_LINK = urls.website.support.copyright
|
||||
export const SUPPORT_PAGE = urls.website.support.index
|
||||
|
||||
export const NEW_TO_OLD_REASON_MAPPING: Record<string, string> = {}
|
||||
|
||||
|
||||
+20
-8
@@ -204,18 +204,37 @@ export const EMOJI_REACTION_LIMIT = 5
|
||||
|
||||
export const urls = {
|
||||
website: {
|
||||
about: 'https://bsky.social/about',
|
||||
faq: 'https://bsky.social/about/faq',
|
||||
jobs: 'https://bsky.social/about/join',
|
||||
blog: {
|
||||
index: 'https://bsky.social/about/blog',
|
||||
findFriendsAnnouncement:
|
||||
'https://bsky.social/about/blog/12-16-2025-find-friends',
|
||||
initialVerificationAnnouncement: `https://bsky.social/about/blog/04-21-2025-verification`,
|
||||
searchTipsAndTricks: 'https://bsky.social/about/blog/05-31-2024-search',
|
||||
updatedTermsAndPolicies:
|
||||
'https://bsky.social/about/blog/08-14-2025-updated-terms-and-policies',
|
||||
handleTutorial:
|
||||
'https://bsky.social/about/blog/4-28-2023-domain-handle-tutorial',
|
||||
},
|
||||
support: {
|
||||
index: `https://bsky.social/about/support`,
|
||||
findFriendsPrivacyPolicy:
|
||||
'https://bsky.social/about/support/find-friends-privacy-policy',
|
||||
tos: `https://bsky.social/about/support/tos`,
|
||||
privacy: `https://bsky.social/about/support/privacy-policy`,
|
||||
community: `https://bsky.social/about/support/community-guidelines`,
|
||||
communityDeprecated: `https://bsky.social/about/support/community-guidelines-deprecated`,
|
||||
copyright: `https://bsky.social/about/support/copyright`,
|
||||
},
|
||||
atproto: {
|
||||
website: {
|
||||
faq: 'https://atproto.com/guides/faq',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
} as const
|
||||
|
||||
export const PUBLIC_APPVIEW = 'https://api.bsky.app'
|
||||
export const PUBLIC_APPVIEW_DID = 'did:web:api.bsky.app'
|
||||
@@ -246,10 +265,3 @@ export const BLUESKY_MOD_SERVICE_HEADERS = {
|
||||
export const BLUESKY_NOTIF_SERVICE_HEADERS = {
|
||||
'atproto-proxy': `${BLUESKY_PROXY_DID}#bsky_notif`,
|
||||
}
|
||||
|
||||
export const webLinks = {
|
||||
tos: `https://bsky.social/about/support/tos`,
|
||||
privacy: `https://bsky.social/about/support/privacy-policy`,
|
||||
community: `https://bsky.social/about/support/community-guidelines`,
|
||||
communityDeprecated: `https://bsky.social/about/support/community-guidelines-deprecated`,
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import {Trans} from '@lingui/react/macro'
|
||||
import {type NativeStackScreenProps} from '@react-navigation/native-stack'
|
||||
import {useMutation} from '@tanstack/react-query'
|
||||
|
||||
import {STATUS_PAGE_URL} from '#/lib/constants'
|
||||
import {STATUS_PAGE_URL, urls} from '#/lib/constants'
|
||||
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||
import * as SettingsList from '#/screens/Settings/components/SettingsList'
|
||||
import {Atom_Stroke2_Corner0_Rounded as AtomIcon} from '#/components/icons/Atom'
|
||||
@@ -79,7 +79,7 @@ export function AboutSettingsScreen({}: Props) {
|
||||
<Layout.Content>
|
||||
<SettingsList.Container>
|
||||
<SettingsList.LinkItem
|
||||
to="https://bsky.social/about/support/tos"
|
||||
to={urls.website.support.tos}
|
||||
label={_(msg`Terms of Service`)}>
|
||||
<SettingsList.ItemIcon icon={NewspaperIcon} />
|
||||
<SettingsList.ItemText>
|
||||
@@ -87,7 +87,7 @@ export function AboutSettingsScreen({}: Props) {
|
||||
</SettingsList.ItemText>
|
||||
</SettingsList.LinkItem>
|
||||
<SettingsList.LinkItem
|
||||
to="https://bsky.social/about/support/privacy-policy"
|
||||
to={urls.website.support.privacy}
|
||||
label={_(msg`Privacy Policy`)}>
|
||||
<SettingsList.ItemIcon icon={NewspaperIcon} />
|
||||
<SettingsList.ItemText>
|
||||
|
||||
@@ -281,7 +281,7 @@ function ProvidedHandlePage({
|
||||
context: `english-only-resource`,
|
||||
}),
|
||||
)}
|
||||
to="https://bsky.social/about/blog/4-28-2023-domain-handle-tutorial"
|
||||
to={urls.website.blog.handleTutorial}
|
||||
style={[a.font_semi_bold]}
|
||||
disableMismatchWarning>
|
||||
Learn more here.
|
||||
|
||||
@@ -4,7 +4,7 @@ import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {Trans} from '@lingui/react/macro'
|
||||
|
||||
import {DM_SERVICE_HEADERS} from '#/lib/constants'
|
||||
import {DM_SERVICE_HEADERS, urls} from '#/lib/constants'
|
||||
import {useCleanError} from '#/lib/hooks/useCleanError'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {logger} from '#/logger'
|
||||
@@ -343,7 +343,7 @@ function DeleteAccountDialogInner({
|
||||
<InlineLinkText
|
||||
label={_(msg`Learn more about the AT Protocol.`)}
|
||||
style={[a.text_md]}
|
||||
to="https://bsky.social/about/faq">
|
||||
to={urls.website.faq}>
|
||||
AT Protocol
|
||||
</InlineLinkText>{' '}
|
||||
services you use with this account.
|
||||
|
||||
@@ -12,6 +12,7 @@ import {countGraphemes} from 'unicode-segmenter/grapheme'
|
||||
import {
|
||||
BLUESKY_MOD_SERVICE_HEADERS,
|
||||
MAX_REPORT_REASON_GRAPHEME_LENGTH,
|
||||
urls,
|
||||
} from '#/lib/constants'
|
||||
import {cleanError} from '#/lib/strings/errors'
|
||||
import {useAgent, useSession, useSessionApi} from '#/state/session'
|
||||
@@ -211,7 +212,7 @@ export function Takendown() {
|
||||
Your account was found to be in violation of the{' '}
|
||||
<SimpleInlineLinkText
|
||||
label={_(msg`Bluesky Social Terms of Service`)}
|
||||
to="https://bsky.social/about/support/tos"
|
||||
to={urls.website.support.tos}
|
||||
style={[a.text_md, a.leading_snug]}>
|
||||
Bluesky Social Terms of Service
|
||||
</SimpleInlineLinkText>
|
||||
|
||||
@@ -5,6 +5,7 @@ import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {Trans} from '@lingui/react/macro'
|
||||
|
||||
import {urls} from '#/lib/constants'
|
||||
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
|
||||
import {useKawaiiMode} from '#/state/preferences/kawaii'
|
||||
import {ErrorBoundary} from '#/view/com/util/ErrorBoundary'
|
||||
@@ -171,17 +172,17 @@ function Footer() {
|
||||
]}>
|
||||
<InlineLinkText
|
||||
label={_(msg`Learn more about Bluesky`)}
|
||||
to="https://bsky.social">
|
||||
to={urls.website.about}>
|
||||
<Trans>Business</Trans>
|
||||
</InlineLinkText>
|
||||
<InlineLinkText
|
||||
label={_(msg`Read the Bluesky blog`)}
|
||||
to="https://bsky.social/about/blog">
|
||||
to={urls.website.blog.index}>
|
||||
<Trans>Blog</Trans>
|
||||
</InlineLinkText>
|
||||
<InlineLinkText
|
||||
label={_(msg`See jobs at Bluesky`)}
|
||||
to="https://bsky.social/about/join">
|
||||
to={urls.website.jobs}>
|
||||
<Trans comment="Link to a page with job openings at Bluesky">
|
||||
Jobs
|
||||
</Trans>
|
||||
|
||||
@@ -6,13 +6,12 @@ import {useLingui} from '@lingui/react'
|
||||
import {Plural, Trans} from '@lingui/react/macro'
|
||||
import {StackActions, useNavigation} from '@react-navigation/native'
|
||||
|
||||
import {FEEDBACK_FORM_URL, HELP_DESK_URL} from '#/lib/constants'
|
||||
import {FEEDBACK_FORM_URL, HELP_DESK_URL, urls} from '#/lib/constants'
|
||||
import {type PressableScale} from '#/lib/custom-animations/PressableScale'
|
||||
import {useNavigationTabState} from '#/lib/hooks/useNavigationTabState'
|
||||
import {getTabState, TabState} from '#/lib/routes/helpers'
|
||||
import {type NavigationProp} from '#/lib/routes/types'
|
||||
import {sanitizeHandle} from '#/lib/strings/handles'
|
||||
import {colors} from '#/lib/styles'
|
||||
import {emitSoftReset} from '#/state/events'
|
||||
import {useKawaiiMode} from '#/state/preferences/kawaii'
|
||||
import {useUnreadNotifications} from '#/state/queries/notifications/unread'
|
||||
@@ -647,7 +646,7 @@ function MenuItem({icon, label, count, bold, onPress}: MenuItemProps) {
|
||||
a.font_semi_bold,
|
||||
{
|
||||
fontVariant: ['tabular-nums'],
|
||||
color: colors.white,
|
||||
color: t.palette.white,
|
||||
},
|
||||
]}
|
||||
numberOfLines={1}>
|
||||
@@ -683,12 +682,12 @@ function ExtraLinks() {
|
||||
<InlineLinkText
|
||||
style={[a.text_md]}
|
||||
label={_(msg`Terms of Service`)}
|
||||
to="https://bsky.social/about/support/tos">
|
||||
to={urls.website.support.tos}>
|
||||
<Trans>Terms of Service</Trans>
|
||||
</InlineLinkText>
|
||||
<InlineLinkText
|
||||
style={[a.text_md]}
|
||||
to="https://bsky.social/about/support/privacy-policy"
|
||||
to={urls.website.support.privacy}
|
||||
label={_(msg`Privacy Policy`)}>
|
||||
<Trans>Privacy Policy</Trans>
|
||||
</InlineLinkText>
|
||||
|
||||
@@ -5,7 +5,7 @@ import {useLingui} from '@lingui/react'
|
||||
import {Trans} from '@lingui/react/macro'
|
||||
import {useNavigation} from '@react-navigation/core'
|
||||
|
||||
import {FEEDBACK_FORM_URL, HELP_DESK_URL} from '#/lib/constants'
|
||||
import {FEEDBACK_FORM_URL, HELP_DESK_URL, urls} from '#/lib/constants'
|
||||
import {useKawaiiMode} from '#/state/preferences/kawaii'
|
||||
import {useSession} from '#/state/session'
|
||||
import {DesktopFeeds} from '#/view/shell/desktop/Feeds'
|
||||
@@ -112,14 +112,14 @@ export function DesktopRightNav({routeName}: {routeName: string}) {
|
||||
</>
|
||||
)}
|
||||
<InlineLinkText
|
||||
to="https://bsky.social/about/support/privacy-policy"
|
||||
to={urls.website.support.privacy}
|
||||
style={[t.atoms.text_contrast_medium]}
|
||||
label={_(msg`Privacy`)}>
|
||||
{_(msg`Privacy`)}
|
||||
</InlineLinkText>
|
||||
<Text style={[t.atoms.text_contrast_low]}>{' ∙ '}</Text>
|
||||
<InlineLinkText
|
||||
to="https://bsky.social/about/support/tos"
|
||||
to={urls.website.support.tos}
|
||||
style={[t.atoms.text_contrast_medium]}
|
||||
label={_(msg`Terms`)}>
|
||||
{_(msg`Terms`)}
|
||||
|
||||
Reference in New Issue
Block a user