diff --git a/package.json b/package.json index d6d80c69..3697d8be 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "native": "220214", "major": 3, "minor": 5, - "patch": 3, + "patch": 4, "expo": "44.0.0" }, "description": "tooot app for Mastodon", diff --git a/src/components/Instance.tsx b/src/components/Instance.tsx index 26c1f6fc..868929c0 100644 --- a/src/components/Instance.tsx +++ b/src/components/Instance.tsx @@ -180,7 +180,11 @@ const ComponentInstance: React.FC = ({ 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: { diff --git a/src/i18n/en/screens/tabs.json b/src/i18n/en/screens/tabs.json index 82069b25..399daedc 100644 --- a/src/i18n/en/screens/tabs.json +++ b/src/i18n/en/screens/tabs.json @@ -67,6 +67,9 @@ "settings": { "name": "App Settings" }, + "webSettings": { + "name": "More Account Settings" + }, "switch": { "name": "Switch Account" } diff --git a/src/screens/Tabs/Me/Root/Settings.tsx b/src/screens/Tabs/Me/Root/Settings.tsx index a0078c63..5e08d0f5 100644 --- a/src/screens/Tabs/Me/Root/Settings.tsx +++ b/src/screens/Tabs/Me/Root/Settings.tsx @@ -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() + const instanceActive = useSelector(getInstanceActive) + const url = useSelector(getInstanceUrl) return ( @@ -15,6 +20,19 @@ const Settings: React.FC = () => { title={t('me.stacks.settings.name')} onPress={() => navigation.navigate('Tab-Me-Settings')} /> + {instanceActive !== -1 ? ( + + WebBrowser.openAuthSessionAsync( + `https://${url}/settings/preferences`, + '' + ) + } + /> + ) : null} ) } diff --git a/src/screens/Tabs/Me/Switch.tsx b/src/screens/Tabs/Me/Switch.tsx index 213f22b2..09c507b5 100644 --- a/src/screens/Tabs/Me/Switch.tsx +++ b/src/screens/Tabs/Me/Switch.tsx @@ -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,9 @@ const TabMeSwitch: React.FC = () => { const instanceActive = useSelector(getInstanceActive, () => true) const scrollViewRef = useRef(null) + useEffect(() => { + scrollViewRef.current?.scrollToEnd({ animated: true }) + }, []) return ( { style={styles.base} keyboardShouldPersistTaps='always' > + + + {t('me.switch.new')} + + + + {t('me.switch.existing')} @@ -99,17 +113,6 @@ const TabMeSwitch: React.FC = () => { : null} - - - - {t('me.switch.new')} - - - ) @@ -126,12 +129,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,