mirror of
https://github.com/tooot-app/app
synced 2025-03-03 19:20:11 +01:00
commit
1429652460
@ -4,7 +4,7 @@
|
|||||||
"native": "220214",
|
"native": "220214",
|
||||||
"major": 3,
|
"major": 3,
|
||||||
"minor": 5,
|
"minor": 5,
|
||||||
"patch": 3,
|
"patch": 4,
|
||||||
"expo": "44.0.0"
|
"expo": "44.0.0"
|
||||||
},
|
},
|
||||||
"description": "tooot app for Mastodon",
|
"description": "tooot app for Mastodon",
|
||||||
|
@ -180,7 +180,11 @@ const ComponentInstance: React.FC<Props> = ({
|
|||||||
keyboardAppearance={mode}
|
keyboardAppearance={mode}
|
||||||
{...(scrollViewRef && {
|
{...(scrollViewRef && {
|
||||||
onFocus: () =>
|
onFocus: () =>
|
||||||
setTimeout(() => scrollViewRef.current?.scrollToEnd(), 150)
|
setTimeout(
|
||||||
|
() =>
|
||||||
|
scrollViewRef.current?.scrollTo({ y: 0, animated: true }),
|
||||||
|
150
|
||||||
|
)
|
||||||
})}
|
})}
|
||||||
autoCorrect={false}
|
autoCorrect={false}
|
||||||
spellCheck={false}
|
spellCheck={false}
|
||||||
@ -276,7 +280,7 @@ const styles = StyleSheet.create({
|
|||||||
imageContainer: { flexDirection: 'row' },
|
imageContainer: { flexDirection: 'row' },
|
||||||
image: { resizeMode: 'contain', flex: 1, aspectRatio: 16 / 9 },
|
image: { resizeMode: 'contain', flex: 1, aspectRatio: 16 / 9 },
|
||||||
base: {
|
base: {
|
||||||
marginVertical: StyleConstants.Spacing.L,
|
marginTop: StyleConstants.Spacing.L,
|
||||||
marginHorizontal: StyleConstants.Spacing.Global.PagePadding
|
marginHorizontal: StyleConstants.Spacing.Global.PagePadding
|
||||||
},
|
},
|
||||||
inputRow: {
|
inputRow: {
|
||||||
|
@ -67,6 +67,9 @@
|
|||||||
"settings": {
|
"settings": {
|
||||||
"name": "App Settings"
|
"name": "App Settings"
|
||||||
},
|
},
|
||||||
|
"webSettings": {
|
||||||
|
"name": "More Account Settings"
|
||||||
|
},
|
||||||
"switch": {
|
"switch": {
|
||||||
"name": "Switch Account"
|
"name": "Switch Account"
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
import { MenuContainer, MenuRow } from '@components/Menu'
|
import { MenuContainer, MenuRow } from '@components/Menu'
|
||||||
import { useNavigation } from '@react-navigation/native'
|
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 React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
import { useSelector } from 'react-redux'
|
||||||
|
|
||||||
const Settings: React.FC = () => {
|
const Settings: React.FC = () => {
|
||||||
const { t } = useTranslation('screenTabs')
|
const { t } = useTranslation('screenTabs')
|
||||||
const navigation = useNavigation<any>()
|
const navigation = useNavigation<any>()
|
||||||
|
const instanceActive = useSelector(getInstanceActive)
|
||||||
|
const url = useSelector(getInstanceUrl)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MenuContainer>
|
<MenuContainer>
|
||||||
@ -15,6 +20,19 @@ const Settings: React.FC = () => {
|
|||||||
title={t('me.stacks.settings.name')}
|
title={t('me.stacks.settings.name')}
|
||||||
onPress={() => navigation.navigate('Tab-Me-Settings')}
|
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>
|
</MenuContainer>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
} from '@utils/slices/instancesSlice'
|
} from '@utils/slices/instancesSlice'
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import React, { useRef } from 'react'
|
import React, { useEffect, useRef } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import {
|
import {
|
||||||
KeyboardAvoidingView,
|
KeyboardAvoidingView,
|
||||||
@ -56,6 +56,9 @@ const TabMeSwitch: React.FC = () => {
|
|||||||
const instanceActive = useSelector(getInstanceActive, () => true)
|
const instanceActive = useSelector(getInstanceActive, () => true)
|
||||||
|
|
||||||
const scrollViewRef = useRef<ScrollView>(null)
|
const scrollViewRef = useRef<ScrollView>(null)
|
||||||
|
useEffect(() => {
|
||||||
|
scrollViewRef.current?.scrollToEnd({ animated: true })
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<KeyboardAvoidingView
|
<KeyboardAvoidingView
|
||||||
@ -67,8 +70,19 @@ const TabMeSwitch: React.FC = () => {
|
|||||||
style={styles.base}
|
style={styles.base}
|
||||||
keyboardShouldPersistTaps='always'
|
keyboardShouldPersistTaps='always'
|
||||||
>
|
>
|
||||||
|
<View>
|
||||||
|
<Text style={[styles.header, { color: colors.primaryDefault }]}>
|
||||||
|
{t('me.switch.new')}
|
||||||
|
</Text>
|
||||||
|
<ComponentInstance
|
||||||
|
scrollViewRef={scrollViewRef}
|
||||||
|
disableHeaderImage
|
||||||
|
goBack
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
style={[styles.firstSection, { borderBottomColor: colors.border }]}
|
style={[styles.firstSection, , { borderTopColor: colors.border }]}
|
||||||
>
|
>
|
||||||
<Text style={[styles.header, { color: colors.primaryDefault }]}>
|
<Text style={[styles.header, { color: colors.primaryDefault }]}>
|
||||||
{t('me.switch.existing')}
|
{t('me.switch.existing')}
|
||||||
@ -99,17 +113,6 @@ const TabMeSwitch: React.FC = () => {
|
|||||||
: null}
|
: null}
|
||||||
</View>
|
</View>
|
||||||
</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>
|
</ScrollView>
|
||||||
</KeyboardAvoidingView>
|
</KeyboardAvoidingView>
|
||||||
)
|
)
|
||||||
@ -126,12 +129,9 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
firstSection: {
|
firstSection: {
|
||||||
marginTop: StyleConstants.Spacing.S,
|
marginTop: StyleConstants.Spacing.S,
|
||||||
|
paddingTop: StyleConstants.Spacing.M,
|
||||||
marginHorizontal: StyleConstants.Spacing.Global.PagePadding,
|
marginHorizontal: StyleConstants.Spacing.Global.PagePadding,
|
||||||
paddingBottom: StyleConstants.Spacing.S,
|
borderTopWidth: StyleSheet.hairlineWidth
|
||||||
borderBottomWidth: StyleSheet.hairlineWidth
|
|
||||||
},
|
|
||||||
secondSection: {
|
|
||||||
paddingTop: StyleConstants.Spacing.M
|
|
||||||
},
|
},
|
||||||
accountButtons: {
|
accountButtons: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user