Skip to content

Commit

Permalink
Merge branch 'main' into romanian-translation
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiu-cristea authored Dec 3, 2024
2 parents 29f6471 + 0c71f81 commit 8c4ef29
Show file tree
Hide file tree
Showing 22 changed files with 726 additions and 373 deletions.
12 changes: 9 additions & 3 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,34 @@ module.exports = function (config) {
CFBundleSpokenName: 'Blue Sky',
CFBundleLocalizations: [
'en',
'an',
'ast',
'ca',
'de',
'es',
'fi',
'fr',
'ga',
'gl',
'hi',
'hu',
'id',
'it',
'ja',
'ko',
'nl',
'pl',
'pt',
'pt-BR',
'ro',
'ru',
'th',
'tr',
'uk',
'zh_CN',
'zh_HK',
'zh_TW',
'vi',
'yue-Hant',
'zh-Hans',
'zh-Hant',
],
},
associatedDomains: ASSOCIATED_DOMAINS,
Expand Down
2 changes: 1 addition & 1 deletion lingui.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
module.exports = {
locales: [
'en',
'ast',
'an',
'ast',
'ca',
'de',
'en-GB',
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"@radix-ui/react-focus-guards": "^1.1.1",
"@radix-ui/react-focus-scope": "^1.1.0",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-masked-view/masked-view": "0.3.0",
"@react-native-menu/menu": "^1.1.0",
"@react-native-picker/picker": "2.6.1",
"@react-navigation/bottom-tabs": "^6.5.20",
Expand Down Expand Up @@ -170,7 +169,7 @@
"react-keyed-flatten-children": "^3.0.0",
"react-native": "0.74.1",
"react-native-compressor": "^1.8.24",
"react-native-date-picker": "^4.4.2",
"react-native-date-picker": "^5.0.7",
"react-native-drawer-layout": "^4.0.1",
"react-native-gesture-handler": "2.20.0",
"react-native-get-random-values": "~1.11.0",
Expand Down
85 changes: 22 additions & 63 deletions src/Splash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import {useSafeAreaInsets} from 'react-native-safe-area-context'
import Svg, {Path, SvgProps} from 'react-native-svg'
import {Image} from 'expo-image'
import * as SplashScreen from 'expo-splash-screen'
import MaskedView from '@react-native-masked-view/masked-view'

import {isAndroid} from '#/platform/detection'
import {Logotype} from '#/view/icons/Logotype'
// @ts-ignore
import splashImagePointer from '../assets/splash.png'
Expand Down Expand Up @@ -53,8 +51,6 @@ type Props = {
isReady: boolean
}

const AnimatedLogo = Animated.createAnimatedComponent(Logo)

export function Splash(props: React.PropsWithChildren<Props>) {
'use no memo'
const insets = useSafeAreaInsets()
Expand Down Expand Up @@ -152,8 +148,6 @@ export function Splash(props: React.PropsWithChildren<Props>) {
{duration: 400, easing: Easing.out(Easing.cubic)},
async () => {
// set these values to check animation at specific point
// outroLogo.set(0.1)
// outroApp.set(0.1)
outroLogo.set(() =>
withTiming(
1,
Expand Down Expand Up @@ -221,66 +215,31 @@ export function Splash(props: React.PropsWithChildren<Props>) {
</View>
)}

{isReady &&
(isAndroid || reduceMotion === true ? (
// Use a simple fade on older versions of android (work around a bug)
<>
<Animated.View style={[{flex: 1}, appAnimation]}>
{props.children}
</Animated.View>
{isReady && (
<>
<Animated.View style={[{flex: 1}, appAnimation]}>
{props.children}
</Animated.View>

{!isAnimationComplete && (
<Animated.View
style={[
StyleSheet.absoluteFillObject,
logoWrapperAnimation,
{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
transform: [{translateY: -(insets.top / 2)}, {scale: 0.1}], // scale from 1000px to 100px
},
]}>
<AnimatedLogo
fill={logoBg}
style={[{opacity: 0}, logoAnimations]}
/>
{!isAnimationComplete && (
<Animated.View
style={[
StyleSheet.absoluteFillObject,
logoWrapperAnimation,
{
flex: 1,
justifyContent: 'center',
alignItems: 'center',
transform: [{translateY: -(insets.top / 2)}, {scale: 0.1}], // scale from 1000px to 100px
},
]}>
<Animated.View style={[logoAnimations]}>
<Logo fill={logoBg} />
</Animated.View>
)}
</>
) : (
<MaskedView
style={[StyleSheet.absoluteFillObject]}
maskElement={
<Animated.View
style={[
{
// Transparent background because mask is based off alpha channel.
backgroundColor: 'transparent',
flex: 1,
justifyContent: 'center',
alignItems: 'center',
transform: [{translateY: -(insets.top / 2)}, {scale: 0.1}], // scale from 1000px to 100px
},
]}>
<AnimatedLogo fill={logoBg} style={[logoAnimations]} />
</Animated.View>
}>
{!isAnimationComplete && (
<View
style={[
StyleSheet.absoluteFillObject,
{
backgroundColor: logoBg,
},
]}
/>
)}
<Animated.View style={[{flex: 1}, appAnimation]}>
{props.children}
</Animated.View>
</MaskedView>
))}
)}
</>
)}
</View>
)
}
3 changes: 3 additions & 0 deletions src/components/forms/DateField/index.android.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ export function DateField({
/>

{open && (
// Android implementation of DatePicker currently does not change default button colors according to theme and only takes hex values for buttonColor
// Can remove the buttonColor setting if/when this PR is merged: https://github.com/henninghall/react-native-date-picker/pull/871
<DatePicker
modal
open
timeZoneOffsetInMinutes={0}
theme={t.name === 'light' ? 'light' : 'dark'}
buttonColor={t.name === 'light' ? '#000000' : '#ffffff'}
date={new Date(value)}
onConfirm={onChangeInternal}
onCancel={onCancel}
Expand Down
2 changes: 1 addition & 1 deletion src/components/hooks/dates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ import {useLanguagePrefs} from '#/state/preferences'
*/
const locales: Record<AppLanguage, Locale | undefined> = {
en: undefined,
ast: undefined,
an: undefined,
ast: undefined,
ca,
de,
['en-GB']: enGB,
Expand Down
2 changes: 1 addition & 1 deletion src/components/icons/VideoClip.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createSinglePathSVG} from './TEMPLATE'

export const VideoClip_Stroke2_Corner0_Rounded = createSinglePathSVG({
path: 'M3 4a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4Zm2 1v2h2V5H5Zm4 0v6h6V5H9Zm8 0v2h2V5h-2Zm2 4h-2v2h2V9Zm0 4h-2v2.444h2V13Zm0 4.444h-2V19h2v-1.556ZM15 19v-6H9v6h6Zm-8 0v-2H5v2h2Zm-2-4h2v-2H5v2Zm0-4h2V9H5v2Z',
path: 'M3 4a1 1 0 011-1h16a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4Zm2 1v2h2V5H5Zm4 0v6h6V5H9Zm8 0v2h2V5h-2Zm2 4h-2v2h2V9Zm0 4h-2v2h2V13Zm0 4h-2V19h2ZM15 19v-6H9v6h6Zm-8 0v-2H5v2h2Zm-2-4h2v-2H5v2Zm0-4h2V9H5v2Z',
})
10 changes: 10 additions & 0 deletions src/lib/hooks/useOpenLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ import {useCallback} from 'react'
import {Linking} from 'react-native'
import * as WebBrowser from 'expo-web-browser'

import {logEvent} from '#/lib/statsig/statsig'
import {
createBskyAppAbsoluteUrl,
isBskyAppUrl,
isBskyRSSUrl,
isRelativeUrl,
toNiceDomain,
} from '#/lib/strings/url-helpers'
import {isNative} from '#/platform/detection'
import {useModalControls} from '#/state/modals'
Expand All @@ -25,6 +28,13 @@ export function useOpenLink() {
url = createBskyAppAbsoluteUrl(url)
}

if (!isBskyAppUrl(url)) {
logEvent('link:clicked', {
domain: toNiceDomain(url),
url,
})
}

if (isNative && !url.startsWith('mailto:')) {
if (override === undefined && enabled === undefined) {
openModal({
Expand Down
10 changes: 4 additions & 6 deletions src/lib/statsig/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ export type LogEvents = {
feedUrl: string
feedType: string
index: number
reason:
| 'focus'
| 'tabbar-click'
| 'pager-swipe'
| 'desktop-sidebar-click'
| 'starter-pack-initial-feed'
}
'feed:endReached': {
feedUrl: string
Expand Down Expand Up @@ -217,6 +211,10 @@ export type LogEvents = {
'starterPack:opened': {
starterPack: string
}
'link:clicked': {
url: string
domain: string
}

'feed:interstitial:profileCard:press': {}
'feed:interstitial:feedCard:press': {}
Expand Down
4 changes: 2 additions & 2 deletions src/locale/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ interface AppLanguageConfig {
export const APP_LANGUAGES: AppLanguageConfig[] = [
{code2: AppLanguage.en, name: 'English'},
{code2: AppLanguage.an, name: 'Aragonés – Aragonese'},
{code2: AppLanguage.ast, name: 'Asturianu - Asturian'},
{code2: AppLanguage.ast, name: 'Asturianu Asturian'},
{code2: AppLanguage.ca, name: 'Català – Catalan'},
{code2: AppLanguage.de, name: 'Deutsch – German'},
{code2: AppLanguage.en_GB, name: 'English (UK)'},
{code2: AppLanguage.es, name: 'Español – Spanish'},
{code2: AppLanguage.fi, name: 'Suomi – Finnish'},
{code2: AppLanguage.fr, name: 'Français – French'},
{code2: AppLanguage.ga, name: 'Gaeilge – Irish'},
{code2: AppLanguage.gl, name: 'Galego - Galician'},
{code2: AppLanguage.gl, name: 'Galego Galician'},
{code2: AppLanguage.hi, name: 'हिंदी – Hindi'},
{code2: AppLanguage.hu, name: 'magyar – Hungarian'},
{code2: AppLanguage.id, name: 'Bahasa Indonesia – Indonesian'},
Expand Down
6 changes: 4 additions & 2 deletions src/view/com/feeds/FeedPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const POLL_FREQ = 60e3 // 60sec
export function FeedPage({
testID,
isPageFocused,
isPageAdjacent,
feed,
feedParams,
renderEmptyState,
Expand All @@ -42,6 +43,7 @@ export function FeedPage({
feed: FeedDescriptor
feedParams?: FeedParams
isPageFocused: boolean
isPageAdjacent: boolean
renderEmptyState: () => JSX.Element
renderEndOfFeed?: () => JSX.Element
savedFeedConfig?: AppBskyActorDefs.SavedFeed
Expand Down Expand Up @@ -111,11 +113,11 @@ export function FeedPage({
<FeedFeedbackProvider value={feedFeedback}>
<Feed
testID={testID ? `${testID}-feed` : undefined}
enabled={isPageFocused}
enabled={isPageFocused || isPageAdjacent}
feed={feed}
feedParams={feedParams}
pollInterval={POLL_FREQ}
disablePoll={hasNew}
disablePoll={hasNew || !isPageFocused}
scrollElRef={scrollElRef}
onScrolledDownChange={setIsScrolledDown}
onHasNew={setHasNew}
Expand Down
5 changes: 2 additions & 3 deletions src/view/com/home/HomeHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import {useNavigation} from '@react-navigation/native'

import {usePalette} from '#/lib/hooks/usePalette'
import {NavigationProp} from '#/lib/routes/types'
import {FeedSourceInfo} from '#/state/queries/feed'
import {useSession} from '#/state/session'
Expand All @@ -19,7 +18,6 @@ export function HomeHeader(
const {feeds} = props
const {hasSession} = useSession()
const navigation = useNavigation<NavigationProp>()
const pal = usePalette('default')

const hasPinnedCustom = React.useMemo<boolean>(() => {
if (!hasSession) return false
Expand Down Expand Up @@ -61,7 +59,8 @@ export function HomeHeader(
onSelect={onSelect}
testID={props.testID}
items={items}
indicatorColor={pal.colors.link}
dragProgress={props.dragProgress}
dragState={props.dragState}
/>
</HomeHeaderLayout>
)
Expand Down
Loading

0 comments on commit 8c4ef29

Please sign in to comment.