Refine RN 0.64

This commit is contained in:
Zhiyuan Zheng 2021-03-16 23:15:37 +01:00
parent d2addd1b11
commit bcb55254f9
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
18 changed files with 91 additions and 88 deletions

View File

@ -12,12 +12,12 @@ RELEASE_CHANNEL = "#{VERSIONS[:major]}-#{ENVIRONMENT}"
BUILD_NUMBER = ENV["GITHUB_RUN_NUMBER"] BUILD_NUMBER = ENV["GITHUB_RUN_NUMBER"]
GITHUB_REPO = "tooot-app/app" GITHUB_REPO = "tooot-app/app"
case ENVIRONMENT case ENVIRONMENT
when "main"
GITHUB_RELEASE= ""
when "candidate" when "candidate"
GITHUB_RELEASE = "v#{VERSION}-#{VERSIONS[:patch]}" GITHUB_RELEASE = "v#{VERSION}-#{VERSIONS[:patch]}"
when "release" when "release"
GITHUB_RELEASE = "v#{VERSION}" GITHUB_RELEASE = "v#{VERSION}"
else
GITHUB_RELEASE= ""
end end
XCODEPROJ = "./ios/tooot.xcodeproj" XCODEPROJ = "./ios/tooot.xcodeproj"
@ -82,7 +82,7 @@ private_lane :build_ios do
install_pods_ios install_pods_ios
prepare_appstore_ios prepare_appstore_ios
match( type: "appstore", readonly: true ) match( type: "appstore", readonly: true )
build_ios_app( export_method: "app-store", include_symbols: true, include_bitcode: true ) build_ios_app( export_method: "app-store", include_symbols: true, include_bitcode: true, silent: true )
upload_to_testflight( upload_to_testflight(
demo_account_required: true, demo_account_required: true,
distribute_external: true, distribute_external: true,
@ -92,12 +92,12 @@ private_lane :build_ios do
when "release" when "release"
install_pods_ios install_pods_ios
prepare_appstore_ios prepare_appstore_ios
match( type: "appstore", readonly: true, include_bitcode: true ) match( type: "appstore", readonly: true )
build_ios_app( export_method: "app-store" ) build_ios_app( export_method: "app-store", include_bitcode: true, silent: true )
else else
if !is_ci if !is_ci
match( type: "development", readonly: true ) match( type: "development", readonly: true )
build_ios_app( export_method: "development", output_directory: BUILD_DIRECTORY ) build_ios_app( export_method: "development", output_directory: BUILD_DIRECTORY, silent: true )
install_on_device( skip_wifi: true ) install_on_device( skip_wifi: true )
end end
end end

View File

@ -487,7 +487,7 @@ PODS:
- React-RCTVibration - React-RCTVibration
- ReactCommon/turbomodule/core - ReactCommon/turbomodule/core
- Yoga - Yoga
- RNScreens (2.18.1): - RNScreens (2.17.1):
- React-Core - React-Core
- RNSentry (2.3.0): - RNSentry (2.3.0):
- React-Core - React-Core
@ -889,7 +889,7 @@ SPEC CHECKSUMS:
RNFastImage: d4870d58f5936111c56218dbd7fcfc18e65b58ff RNFastImage: d4870d58f5936111c56218dbd7fcfc18e65b58ff
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNReanimated: 64f6c5789f82818c07ba3c71864b73619cb23c76 RNReanimated: 64f6c5789f82818c07ba3c71864b73619cb23c76
RNScreens: f7ad633b2e0190b77b6a7aab7f914fad6f198d8d RNScreens: b6c9607e6fe47c1b6e2f1910d2acd46dd7ecea3a
RNSentry: 4f6907f9a4a41058988ebaa17666e9a402b50ff2 RNSentry: 4f6907f9a4a41058988ebaa17666e9a402b50ff2
RNSVG: ce9d996113475209013317e48b05c21ee988d42e RNSVG: ce9d996113475209013317e48b05c21ee988d42e
SDWebImage: e378178472b735e84b007bfb55514c97948a0598 SDWebImage: e378178472b735e84b007bfb55514c97948a0598

View File

@ -72,7 +72,7 @@
"react-native-pager-view": "^5.1.2", "react-native-pager-view": "^5.1.2",
"react-native-reanimated": "^2.0.0", "react-native-reanimated": "^2.0.0",
"react-native-safe-area-context": "3.2.0", "react-native-safe-area-context": "3.2.0",
"react-native-screens": "~2.18.1", "react-native-screens": "~2.17.1",
"react-native-svg": "12.1.0", "react-native-svg": "12.1.0",
"react-native-swipe-list-view": "^3.2.6", "react-native-swipe-list-view": "^3.2.6",
"react-native-tab-view": "^3.0.0", "react-native-tab-view": "^3.0.0",

View File

@ -140,20 +140,13 @@ const TimelineConversation: React.FC<Props> = ({
/> />
)} )}
</View> </View>
<View <TimelineActions
style={{ queryKey={queryKey}
paddingLeft: highlighted status={conversation.last_status}
? 0 highlighted={highlighted}
: StyleConstants.Avatar.M + StyleConstants.Spacing.S accts={conversation.accounts.map(account => account.acct)}
}} reblog={false}
> />
<TimelineActions
queryKey={queryKey}
status={conversation.last_status}
accts={conversation.accounts.map(account => account.acct)}
reblog={false}
/>
</View>
</> </>
) : null} ) : null}
</Pressable> </Pressable>

View File

@ -132,27 +132,19 @@ const TimelineDefault: React.FC<Props> = ({
<TimelineActionsUsers status={actualStatus} highlighted={highlighted} /> <TimelineActionsUsers status={actualStatus} highlighted={highlighted} />
{queryKey && !disableDetails && ( {queryKey && !disableDetails && (
<View <TimelineActions
style={{ queryKey={queryKey}
paddingLeft: highlighted rootQueryKey={rootQueryKey}
? 0 highlighted={highlighted}
: StyleConstants.Avatar.M + StyleConstants.Spacing.S status={actualStatus}
}} accts={uniqBy(
> ([actualStatus.account] as Mastodon.Account[] & Mastodon.Mention[])
<TimelineActions .concat(actualStatus.mentions)
queryKey={queryKey} .filter(d => d?.id !== instanceAccount?.id),
rootQueryKey={rootQueryKey} d => d.id
status={actualStatus} ).map(d => d.acct)}
accts={uniqBy( reblog={item.reblog ? true : false}
([actualStatus.account] as Mastodon.Account[] & />
Mastodon.Mention[])
.concat(actualStatus.mentions)
.filter(d => d.id !== instanceAccount?.id),
d => d.id
).map(d => d.acct)}
reblog={item.reblog ? true : false}
/>
</View>
)} )}
</Pressable> </Pressable>
) )

View File

@ -129,28 +129,21 @@ const TimelineNotifications: React.FC<Props> = ({
) : null} ) : null}
</View> </View>
{notification.status && ( {notification.status ? (
<View <TimelineActions
style={{ queryKey={queryKey}
paddingLeft: highlighted status={notification.status}
? 0 highlighted={highlighted}
: StyleConstants.Avatar.M + StyleConstants.Spacing.S accts={uniqBy(
}} ([notification.status.account] as Mastodon.Account[] &
> Mastodon.Mention[])
<TimelineActions .concat(notification.status.mentions)
queryKey={queryKey} .filter(d => d.id !== instanceAccount?.id),
status={notification.status} d => d.id
accts={uniqBy( ).map(d => d.acct)}
([notification.status.account] as Mastodon.Account[] & reblog={false}
Mastodon.Mention[]) />
.concat(notification.status.mentions) ) : null}
.filter(d => d.id !== instanceAccount?.id),
d => d.id
).map(d => d.acct)}
reblog={false}
/>
</View>
)}
</Pressable> </Pressable>
) )
} }

View File

@ -9,7 +9,7 @@ import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager' import { useTheme } from '@utils/styles/ThemeManager'
import React, { useCallback, useRef, useState } from 'react' import React, { useCallback, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { StyleSheet, Text, View } from 'react-native' import { Platform, StyleSheet, Text, View } from 'react-native'
import { Circle } from 'react-native-animated-spinkit' import { Circle } from 'react-native-animated-spinkit'
import Animated, { import Animated, {
Extrapolate, Extrapolate,
@ -45,6 +45,9 @@ const TimelineRefresh: React.FC<Props> = ({
fetchingType, fetchingType,
disableRefresh = false disableRefresh = false
}) => { }) => {
if (Platform.OS !== 'ios') {
return null
}
if (disableRefresh) { if (disableRefresh) {
return null return null
} }

View File

@ -17,13 +17,14 @@ import { useQueryClient } from 'react-query'
export interface Props { export interface Props {
queryKey: QueryKeyTimeline queryKey: QueryKeyTimeline
rootQueryKey?: QueryKeyTimeline rootQueryKey?: QueryKeyTimeline
highlighted: boolean
status: Mastodon.Status status: Mastodon.Status
accts: Mastodon.Account['acct'][] // When replying to conversations accts: Mastodon.Account['acct'][] // When replying to conversations
reblog: boolean reblog: boolean
} }
const TimelineActions = React.memo( const TimelineActions = React.memo(
({ queryKey, rootQueryKey, status, accts, reblog }: Props) => { ({ queryKey, rootQueryKey, highlighted, status, accts, reblog }: Props) => {
const navigation = useNavigation() const navigation = useNavigation()
const { t } = useTranslation('componentTimeline') const { t } = useTranslation('componentTimeline')
const { mode, theme } = useTheme() const { mode, theme } = useTheme()
@ -256,7 +257,13 @@ const TimelineActions = React.memo(
) )
return ( return (
<> <View
style={{
paddingLeft: highlighted
? 0
: StyleConstants.Avatar.M + StyleConstants.Spacing.S
}}
>
<View style={styles.actions}> <View style={styles.actions}>
<Pressable <Pressable
style={styles.action} style={styles.action}
@ -285,7 +292,7 @@ const TimelineActions = React.memo(
children={childrenBookmark} children={childrenBookmark}
/> />
</View> </View>
</> </View>
) )
}, },
() => true () => true

View File

@ -24,9 +24,9 @@ const TimelineFullConversation = React.memo(
).length) ? ( ).length) ? (
<Text <Text
style={{ style={{
...StyleConstants.FontStyle.M, ...StyleConstants.FontStyle.S,
color: theme.blue, color: theme.blue,
marginTop: StyleConstants.Font.Size.M / 2 marginTop: StyleConstants.Font.Size.S
}} }}
> >
{t('shared.fullConversation')} {t('shared.fullConversation')}

View File

@ -36,7 +36,7 @@ export default {
function: '转嘟' function: '转嘟'
}, },
bookmarked: { bookmarked: {
function: '收藏嘟文' function: '喜欢嘟文'
} }
}, },
actionsUsers: { actionsUsers: {

View File

@ -1,4 +1,4 @@
export default { export default {
heading: '收藏', heading: '喜欢',
content: {} content: {}
} }

View File

@ -6,7 +6,7 @@ export default {
}, },
statuses: { statuses: {
reblogged_by: '{{count}} 人转嘟', reblogged_by: '{{count}} 人转嘟',
favourited_by: '{{count}} 人收藏' favourited_by: '{{count}} 人喜欢'
} }
} }
} }

View File

@ -1,5 +1,5 @@
import analytics from '@components/analytics' import analytics from '@components/analytics'
import { HeaderLeft, HeaderRight } from '@components/Header' import { HeaderCenter, HeaderLeft, HeaderRight } from '@components/Header'
import { StackScreenProps } from '@react-navigation/stack' import { StackScreenProps } from '@react-navigation/stack'
import haptics from '@root/components/haptics' import haptics from '@root/components/haptics'
import formatText from '@screens/Compose/formatText' import formatText from '@screens/Compose/formatText'
@ -371,6 +371,13 @@ const ScreenCompose: React.FC<ScreenComposeProp> = ({
}, },
headerTintColor: headerTintColor:
totalTextCount > maxTootChars ? theme.red : theme.secondary, totalTextCount > maxTootChars ? theme.red : theme.secondary,
headerCenter: () => (
<HeaderCenter
content={`${totalTextCount} / ${maxTootChars}${
__DEV__ ? ` Dirty: ${composeState.dirty.toString()}` : ''
}`}
/>
),
headerRight headerRight
}} }}
/> />

View File

@ -39,7 +39,8 @@ const ComposeEditAttachmentSubmit: React.FC<Props> = ({ index }) => {
) { ) {
formData.append( formData.append(
'focus', 'focus',
`${theAttachment.meta.focus.x},${-theAttachment.meta.focus.y}` `${theAttachment.meta.focus.x || 0},${-theAttachment.meta.focus.y ||
0}`
) )
} }

View File

@ -211,7 +211,14 @@ const sharedScreens = (
} }
}: SharedUsersProp) => ({ }: SharedUsersProp) => ({
headerLeft: () => <HeaderLeft onPress={() => navigation.goBack()} />, headerLeft: () => <HeaderLeft onPress={() => navigation.goBack()} />,
headerTitle: t(`sharedUsers:heading.${reference}.${type}`, { count }) headerTitle: t(`sharedUsers:heading.${reference}.${type}`, { count }),
...(Platform.OS === 'android' && {
headerCenter: () => (
<HeaderCenter
content={t(`sharedUsers:heading.${reference}.${type}`, { count })}
/>
)
})
})} })}
/> />
] ]

View File

@ -6,14 +6,14 @@ export const StyleConstants = {
LineHeight: { LineHeight: {
S: 20, S: 20,
M: 22, M: 22,
L: 30 L: 28
}, },
Weight: { Normal: '400' as '400', Bold: '600' as '600' } Weight: { Normal: '400' as '400', Bold: '600' as '600' }
}, },
FontStyle: { FontStyle: {
S: { fontSize: 14, lineHeight: 20 }, S: { fontSize: 14, lineHeight: 20 },
M: { fontSize: 16, lineHeight: 22 }, M: { fontSize: 16, lineHeight: 22 },
L: { fontSize: 20, lineHeight: 30 } L: { fontSize: 20, lineHeight: 28 }
}, },
Spacing: { Spacing: {

View File

@ -1,11 +1,11 @@
import { Dimensions } from 'react-native' // import { Dimensions } from 'react-native'
const { width } = Dimensions.get('screen') // const { width } = Dimensions.get('screen')
const guidelineBaseWidth = 375 // const guidelineBaseWidth = 375
// const guidelineBaseHeight = 667 // const guidelineBaseHeight = 667
const scale = (size: number) => (width / guidelineBaseWidth) * size // const scale = (size: number) => (width / guidelineBaseWidth) * size
// const verticalScale = (size: number) => (height / guidelineBaseHeight) * size // const verticalScale = (size: number) => (height / guidelineBaseHeight) * size
// const adaptiveScale = (size: number, factor: number = 0) => // const adaptiveScale = (size: number, factor: number = 0) =>
// size + (scale(size) - size) * factor // size + (scale(size) - size) * factor

View File

@ -8809,10 +8809,10 @@ react-native-safe-area-view@^0.14.9:
dependencies: dependencies:
hoist-non-react-statics "^2.3.1" hoist-non-react-statics "^2.3.1"
react-native-screens@~2.18.1: react-native-screens@~2.17.1:
version "2.18.1" version "2.17.1"
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-2.18.1.tgz#47b9991c6f762d00d0ed3233e5283d523e859885" resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-2.17.1.tgz#c3c0ac750af48741c5b1635511e6af2a27b74309"
integrity sha512-r5WZLpmx2hHjC1RgMdPq5YpSU9tEhBpUaZ5M1SUtNIONyiLqQVxabhRCINdebIk4depJiIl7yw2Q85zJyeX6fw== integrity sha512-B4gD5e4csvlVwlhf+RNqjQZ9mHTwe/iL3rXondgZxnKz4oW0QAmtLnLRKOrYVxoaJaF9Fy7jhjo//24/472APQ==
react-native-svg@12.1.0: react-native-svg@12.1.0:
version "12.1.0" version "12.1.0"