1
0
mirror of https://github.com/tooot-app/app synced 2024-12-12 09:10:19 +01:00

Merge pull request #243 from tooot-app/main

Release v3.5.4
This commit is contained in:
xmflsct 2022-02-23 00:09:02 +01:00 committed by GitHub
commit e19fdc5201
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 53 additions and 22 deletions

View File

@ -4,7 +4,7 @@
"native": "220214",
"major": 3,
"minor": 5,
"patch": 3,
"patch": 4,
"expo": "44.0.0"
},
"description": "tooot app for Mastodon",

View File

@ -180,7 +180,11 @@ const ComponentInstance: React.FC<Props> = ({
keyboardAppearance={mode}
{...(scrollViewRef && {
onFocus: () =>
setTimeout(() => scrollViewRef.current?.scrollToEnd(), 150)
setTimeout(
() =>
scrollViewRef.current?.scrollTo({ y: 0, animated: true }),
150
)
})}
autoCorrect={false}
spellCheck={false}
@ -276,7 +280,7 @@ const styles = StyleSheet.create({
imageContainer: { flexDirection: 'row' },
image: { resizeMode: 'contain', flex: 1, aspectRatio: 16 / 9 },
base: {
marginVertical: StyleConstants.Spacing.L,
marginTop: StyleConstants.Spacing.L,
marginHorizontal: StyleConstants.Spacing.Global.PagePadding
},
inputRow: {

View File

@ -67,6 +67,9 @@
"settings": {
"name": "App Settings"
},
"webSettings": {
"name": "More Account Settings"
},
"switch": {
"name": "Switch Account"
}

View File

@ -1,3 +1,3 @@
{
"frequentUsed": "常用"
}
}

View File

@ -67,6 +67,9 @@
"settings": {
"name": "应用设置"
},
"webSettings": {
"name": "更多账户设置"
},
"switch": {
"name": "切换账号"
}

View File

@ -1,11 +1,16 @@
import { MenuContainer, MenuRow } from '@components/Menu'
import { useNavigation } from '@react-navigation/native'
import { getInstanceActive, getInstanceUrl } from '@utils/slices/instancesSlice'
import * as WebBrowser from 'expo-web-browser'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { useSelector } from 'react-redux'
const Settings: React.FC = () => {
const { t } = useTranslation('screenTabs')
const navigation = useNavigation<any>()
const instanceActive = useSelector(getInstanceActive)
const url = useSelector(getInstanceUrl)
return (
<MenuContainer>
@ -15,6 +20,19 @@ const Settings: React.FC = () => {
title={t('me.stacks.settings.name')}
onPress={() => navigation.navigate('Tab-Me-Settings')}
/>
{instanceActive !== -1 ? (
<MenuRow
iconFront='Sliders'
iconBack='ExternalLink'
title={t('me.stacks.webSettings.name')}
onPress={() =>
WebBrowser.openAuthSessionAsync(
`https://${url}/settings/preferences`,
''
)
}
/>
) : null}
</MenuContainer>
)
}

View File

@ -11,7 +11,7 @@ import {
} from '@utils/slices/instancesSlice'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useRef } from 'react'
import React, { useEffect, useRef } from 'react'
import { useTranslation } from 'react-i18next'
import {
KeyboardAvoidingView,
@ -56,6 +56,12 @@ const TabMeSwitch: React.FC = () => {
const instanceActive = useSelector(getInstanceActive, () => true)
const scrollViewRef = useRef<ScrollView>(null)
useEffect(() => {
setTimeout(
() => scrollViewRef.current?.scrollToEnd({ animated: true }),
150
)
}, [scrollViewRef.current])
return (
<KeyboardAvoidingView
@ -67,8 +73,19 @@ const TabMeSwitch: React.FC = () => {
style={styles.base}
keyboardShouldPersistTaps='always'
>
<View>
<Text style={[styles.header, { color: colors.primaryDefault }]}>
{t('me.switch.new')}
</Text>
<ComponentInstance
scrollViewRef={scrollViewRef}
disableHeaderImage
goBack
/>
</View>
<View
style={[styles.firstSection, { borderBottomColor: colors.border }]}
style={[styles.firstSection, , { borderTopColor: colors.border }]}
>
<Text style={[styles.header, { color: colors.primaryDefault }]}>
{t('me.switch.existing')}
@ -99,17 +116,6 @@ const TabMeSwitch: React.FC = () => {
: null}
</View>
</View>
<View style={styles.secondSection}>
<Text style={[styles.header, { color: colors.primaryDefault }]}>
{t('me.switch.new')}
</Text>
<ComponentInstance
scrollViewRef={scrollViewRef}
disableHeaderImage
goBack
/>
</View>
</ScrollView>
</KeyboardAvoidingView>
)
@ -126,12 +132,9 @@ const styles = StyleSheet.create({
},
firstSection: {
marginTop: StyleConstants.Spacing.S,
paddingTop: StyleConstants.Spacing.M,
marginHorizontal: StyleConstants.Spacing.Global.PagePadding,
paddingBottom: StyleConstants.Spacing.S,
borderBottomWidth: StyleSheet.hairlineWidth
},
secondSection: {
paddingTop: StyleConstants.Spacing.M
borderTopWidth: StyleSheet.hairlineWidth
},
accountButtons: {
flex: 1,