mirror of https://github.com/tooot-app/app
Removed external instance
This commit is contained in:
parent
08f3036753
commit
4076733061
|
@ -4,7 +4,7 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "999",
|
"id": "999",
|
||||||
"created_at": "2021-01-22T03:48:33.901Z",
|
"created_at": "2021-01-24T11:50:00.901Z",
|
||||||
"sensitive": false,
|
"sensitive": false,
|
||||||
"visibility": "public",
|
"visibility": "public",
|
||||||
"replies_count": 9,
|
"replies_count": 9,
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
"media_attachments": [],
|
"media_attachments": [],
|
||||||
"poll": {
|
"poll": {
|
||||||
"id": "1",
|
"id": "1",
|
||||||
"expires_at": "2021-02-22T03:48:33.901Z",
|
"expires_at": "2021-01-31T11:50:00.901Z",
|
||||||
"expired": false,
|
"expired": false,
|
||||||
"multiple": false,
|
"multiple": false,
|
||||||
"votes_count": 10,
|
"votes_count": 10,
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "1000",
|
"id": "1000",
|
||||||
"created_at": "2021-01-22T03:48:33.901Z",
|
"created_at": "2021-01-24T10:50:00.901Z",
|
||||||
"sensitive": false,
|
"sensitive": false,
|
||||||
"spoiler_text": "",
|
"spoiler_text": "",
|
||||||
"visibility": "public",
|
"visibility": "public",
|
||||||
|
@ -89,7 +89,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "1001",
|
"id": "1001",
|
||||||
"created_at": "2021-01-22T03:48:33.901Z",
|
"created_at": "2021-01-24T09:50:00.901Z",
|
||||||
"spoiler_text": "",
|
"spoiler_text": "",
|
||||||
"visibility": "public",
|
"visibility": "public",
|
||||||
"replies_count": 2,
|
"replies_count": 2,
|
||||||
|
@ -117,7 +117,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "1002",
|
"id": "1002",
|
||||||
"created_at": "2021-01-22T03:48:33.901Z",
|
"created_at": "2021-01-24T08:50:00.901Z",
|
||||||
"sensitive": false,
|
"sensitive": false,
|
||||||
"visibility": "public",
|
"visibility": "public",
|
||||||
"replies_count": 0,
|
"replies_count": 0,
|
||||||
|
@ -145,7 +145,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "1003",
|
"id": "1003",
|
||||||
"created_at": "2021-01-22T03:48:33.901Z",
|
"created_at": "2021-01-24T07:50:00.901Z",
|
||||||
"sensitive": false,
|
"sensitive": false,
|
||||||
"visibility": "public",
|
"visibility": "public",
|
||||||
"replies_count": 0,
|
"replies_count": 0,
|
||||||
|
|
|
@ -179,13 +179,7 @@ const Index: React.FC<Props> = ({ localCorrupt }) => {
|
||||||
case 'Screen-Local':
|
case 'Screen-Local':
|
||||||
return <Icon name='Home' size={size} color={color} />
|
return <Icon name='Home' size={size} color={color} />
|
||||||
case 'Screen-Public':
|
case 'Screen-Public':
|
||||||
return (
|
return <Icon name='Globe' size={size} color={color} />
|
||||||
<Icon
|
|
||||||
name='Globe'
|
|
||||||
size={size}
|
|
||||||
color={!focused ? theme.secondary : color}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
case 'Screen-Post':
|
case 'Screen-Post':
|
||||||
return <Icon name='Plus' size={size} color={color} />
|
return <Icon name='Plus' size={size} color={color} />
|
||||||
case 'Screen-Notifications':
|
case 'Screen-Notifications':
|
||||||
|
@ -279,7 +273,7 @@ const Index: React.FC<Props> = ({ localCorrupt }) => {
|
||||||
>
|
>
|
||||||
<Tab.Navigator
|
<Tab.Navigator
|
||||||
initialRouteName={
|
initialRouteName={
|
||||||
localActiveIndex !== null ? 'Screen-Local' : 'Screen-Public'
|
localActiveIndex !== null ? 'Screen-Local' : 'Screen-Me'
|
||||||
}
|
}
|
||||||
screenOptions={tabNavigatorScreenOptions}
|
screenOptions={tabNavigatorScreenOptions}
|
||||||
tabBarOptions={tabNavigatorTabBarOptions}
|
tabBarOptions={tabNavigatorTabBarOptions}
|
||||||
|
|
|
@ -3,6 +3,7 @@ import { StyleConstants } from '@utils/styles/constants'
|
||||||
import layoutAnimation from '@utils/styles/layoutAnimation'
|
import layoutAnimation from '@utils/styles/layoutAnimation'
|
||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import React, { useEffect, useMemo, useRef } from 'react'
|
import React, { useEffect, useMemo, useRef } from 'react'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
import {
|
import {
|
||||||
Pressable,
|
Pressable,
|
||||||
StyleProp,
|
StyleProp,
|
||||||
|
@ -48,6 +49,7 @@ const Button: React.FC<Props> = ({
|
||||||
overlay = false,
|
overlay = false,
|
||||||
onPress
|
onPress
|
||||||
}) => {
|
}) => {
|
||||||
|
const { i18n } = useTranslation()
|
||||||
const { theme } = useTheme()
|
const { theme } = useTheme()
|
||||||
|
|
||||||
const mounted = useRef(false)
|
const mounted = useRef(false)
|
||||||
|
@ -145,7 +147,7 @@ const Button: React.FC<Props> = ({
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}, [theme, content, loading, disabled, active])
|
}, [i18n.language, theme, content, loading, disabled, active])
|
||||||
|
|
||||||
enum spacingMapping {
|
enum spacingMapping {
|
||||||
XS = 'S',
|
XS = 'S',
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
|
||||||
import { getLocalInstances, remoteUpdate } from '@utils/slices/instancesSlice'
|
import { getLocalInstances, remoteUpdate } 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 * as Linking from 'expo-linking'
|
import * as WebBrowser from 'expo-web-browser'
|
||||||
import { debounce } from 'lodash'
|
import { debounce } from 'lodash'
|
||||||
import React, { useCallback, useMemo, useState } from 'react'
|
import React, { useCallback, useMemo, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
@ -18,6 +18,7 @@ import { useDispatch, useSelector } from 'react-redux'
|
||||||
import { Placeholder, Fade } from 'rn-placeholder'
|
import { Placeholder, Fade } from 'rn-placeholder'
|
||||||
import analytics from './analytics'
|
import analytics from './analytics'
|
||||||
import InstanceAuth from './Instance/Auth'
|
import InstanceAuth from './Instance/Auth'
|
||||||
|
import EULA from './Instance/EULA'
|
||||||
import InstanceInfo from './Instance/Info'
|
import InstanceInfo from './Instance/Info'
|
||||||
import { toast } from './toast'
|
import { toast } from './toast'
|
||||||
|
|
||||||
|
@ -159,6 +160,8 @@ const ComponentInstance: React.FC<Props> = ({
|
||||||
}
|
}
|
||||||
}, [instanceDomain, instanceQuery.data, appsQuery.data])
|
}, [instanceDomain, instanceQuery.data, appsQuery.data])
|
||||||
|
|
||||||
|
const [agreed, setAgreed] = useState(false)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!disableHeaderImage ? (
|
{!disableHeaderImage ? (
|
||||||
|
@ -201,18 +204,15 @@ const ComponentInstance: React.FC<Props> = ({
|
||||||
onPress={processUpdate}
|
onPress={processUpdate}
|
||||||
disabled={
|
disabled={
|
||||||
!instanceQuery.data?.uri ||
|
!instanceQuery.data?.uri ||
|
||||||
(type === 'remote' && !instanceQuery.data.publicAllow)
|
(type === 'remote' && !instanceQuery.data.publicAllow) ||
|
||||||
|
!agreed
|
||||||
}
|
}
|
||||||
loading={instanceQuery.isFetching || appsQuery.isFetching}
|
loading={instanceQuery.isFetching || appsQuery.isFetching}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
{type === 'remote' &&
|
|
||||||
instanceQuery.data &&
|
<EULA agreed={agreed} setAgreed={setAgreed} />
|
||||||
!instanceQuery.data.publicAllow ? (
|
|
||||||
<Text style={[styles.privateInstance, { color: theme.red }]}>
|
|
||||||
{t('server.privateInstance')}
|
|
||||||
</Text>
|
|
||||||
) : null}
|
|
||||||
<View>
|
<View>
|
||||||
<Placeholder
|
<Placeholder
|
||||||
{...(instanceQuery.isFetching && {
|
{...(instanceQuery.isFetching && {
|
||||||
|
@ -277,15 +277,17 @@ const ComponentInstance: React.FC<Props> = ({
|
||||||
style={styles.disclaimerIcon}
|
style={styles.disclaimerIcon}
|
||||||
/>
|
/>
|
||||||
<Text style={[styles.disclaimerText, { color: theme.secondary }]}>
|
<Text style={[styles.disclaimerText, { color: theme.secondary }]}>
|
||||||
{t('server.disclaimer')}
|
{t('server.disclaimer.base')}
|
||||||
<Text
|
<Text
|
||||||
style={{ color: theme.blue }}
|
style={{ color: theme.blue }}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
analytics('view_privacy')
|
analytics('view_privacy')
|
||||||
Linking.openURL('https://tooot.app/privacy')
|
WebBrowser.openBrowserAsync(
|
||||||
|
'https://tooot.app/privacy-policy'
|
||||||
|
)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
https://tooot.app/privacy
|
{t('server.disclaimer.privacy')}
|
||||||
</Text>
|
</Text>
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
import analytics from '@components/analytics'
|
||||||
|
import Icon from '@components/Icon'
|
||||||
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
|
import * as WebBrowser from 'expo-web-browser'
|
||||||
|
import React from 'react'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
import { Pressable, StyleSheet, Text } from 'react-native'
|
||||||
|
|
||||||
|
export interface Props {
|
||||||
|
agreed: boolean
|
||||||
|
setAgreed: React.Dispatch<React.SetStateAction<boolean>>
|
||||||
|
}
|
||||||
|
|
||||||
|
const EULA = React.memo(
|
||||||
|
({ agreed, setAgreed }: Props) => {
|
||||||
|
const { t } = useTranslation('componentInstance')
|
||||||
|
const { theme } = useTheme()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Pressable style={styles.base} onPress={() => setAgreed(!agreed)}>
|
||||||
|
<Icon
|
||||||
|
style={styles.icon}
|
||||||
|
name={agreed ? 'CheckCircle' : 'Circle'}
|
||||||
|
size={StyleConstants.Font.Size.M}
|
||||||
|
color={theme.primary}
|
||||||
|
/>
|
||||||
|
<Text style={[styles.text, { color: theme.primary }]}>
|
||||||
|
{t('server.EULA.base')}
|
||||||
|
<Text
|
||||||
|
style={{ color: theme.blue }}
|
||||||
|
children={t('server.EULA.EULA')}
|
||||||
|
onPress={() => {
|
||||||
|
analytics('view_EULA')
|
||||||
|
WebBrowser.openBrowserAsync(
|
||||||
|
'https://tooot.app/end-user-license-agreement'
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Text>
|
||||||
|
</Pressable>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
(prev, next) => prev.agreed === next.agreed
|
||||||
|
)
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
base: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
marginTop: StyleConstants.Spacing.M,
|
||||||
|
paddingHorizontal: StyleConstants.Spacing.Global.PagePadding,
|
||||||
|
alignItems: 'center'
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
marginRight: StyleConstants.Spacing.XS
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
...StyleConstants.FontStyle.S
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export default EULA
|
|
@ -1,54 +1,37 @@
|
||||||
import { HeaderCenter, HeaderRight } from '@components/Header'
|
import { HeaderRight } from '@components/Header'
|
||||||
import Timeline from '@components/Timelines/Timeline'
|
import Timeline from '@components/Timelines/Timeline'
|
||||||
import SegmentedControl from '@react-native-community/segmented-control'
|
import SegmentedControl from '@react-native-community/segmented-control'
|
||||||
import { useNavigation } from '@react-navigation/native'
|
import { useNavigation } from '@react-navigation/native'
|
||||||
import sharedScreens from '@screens/Shared/sharedScreens'
|
import sharedScreens from '@screens/Shared/sharedScreens'
|
||||||
import { getLocalActiveIndex, getRemoteUrl } from '@utils/slices/instancesSlice'
|
import { getLocalActiveIndex } from '@utils/slices/instancesSlice'
|
||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import React, { useCallback, useMemo, useState } from 'react'
|
import React, { useCallback, useMemo, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Dimensions, Platform, StyleSheet } from 'react-native'
|
import { Dimensions, StyleSheet } from 'react-native'
|
||||||
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
||||||
import { TabView } from 'react-native-tab-view'
|
import { TabView } from 'react-native-tab-view'
|
||||||
import ViewPagerAdapter from 'react-native-tab-view-viewpager-adapter'
|
import ViewPagerAdapter from 'react-native-tab-view-viewpager-adapter'
|
||||||
import { useSelector } from 'react-redux'
|
import { useSelector } from 'react-redux'
|
||||||
import analytics from './analytics'
|
import analytics from './analytics'
|
||||||
|
|
||||||
const Stack = createNativeStackNavigator<
|
const Stack = createNativeStackNavigator<Nav.RemoteStackParamList>()
|
||||||
Nav.LocalStackParamList | Nav.RemoteStackParamList
|
|
||||||
>()
|
|
||||||
|
|
||||||
export interface Props {
|
const Timelines: React.FC = () => {
|
||||||
name: 'Local' | 'Public'
|
|
||||||
}
|
|
||||||
|
|
||||||
const Timelines: React.FC<Props> = ({ name }) => {
|
|
||||||
const { t, i18n } = useTranslation()
|
const { t, i18n } = useTranslation()
|
||||||
const remoteUrl = useSelector(getRemoteUrl)
|
const pages: { title: string; page: App.Pages }[] = [
|
||||||
const mapNameToContent: {
|
|
||||||
[key: string]: { title: string; page: App.Pages }[]
|
|
||||||
} = {
|
|
||||||
Local: [
|
|
||||||
{ title: t('local:heading.segments.left'), page: 'Following' },
|
|
||||||
{ title: t('local:heading.segments.right'), page: 'Local' }
|
|
||||||
],
|
|
||||||
Public: [
|
|
||||||
{ title: t('public:heading.segments.left'), page: 'LocalPublic' },
|
{ title: t('public:heading.segments.left'), page: 'LocalPublic' },
|
||||||
{ title: remoteUrl, page: 'RemotePublic' }
|
{ title: t('public:heading.segments.right'), page: 'Local' }
|
||||||
]
|
]
|
||||||
}
|
|
||||||
|
|
||||||
const navigation = useNavigation()
|
const navigation = useNavigation()
|
||||||
const localActiveIndex = useSelector(getLocalActiveIndex)
|
const localActiveIndex = useSelector(getLocalActiveIndex)
|
||||||
|
|
||||||
const onPressSearch = useCallback(() => {
|
const onPressSearch = useCallback(() => {
|
||||||
analytics('search_tap', { page: mapNameToContent[name][segment].page })
|
analytics('search_tap', { page: pages[segment].page })
|
||||||
navigation.navigate(`Screen-${name}`, { screen: 'Screen-Shared-Search' })
|
navigation.navigate('Screen-Public', { screen: 'Screen-Shared-Search' })
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const routes = mapNameToContent[name]
|
const routes = pages.map(p => ({ key: p.page }))
|
||||||
.filter(p => (localActiveIndex !== null ? true : p.page === 'RemotePublic'))
|
|
||||||
.map(p => ({ key: p.page }))
|
|
||||||
|
|
||||||
const renderScene = useCallback(
|
const renderScene = useCallback(
|
||||||
({
|
({
|
||||||
|
@ -58,11 +41,7 @@ const Timelines: React.FC<Props> = ({ name }) => {
|
||||||
key: App.Pages
|
key: App.Pages
|
||||||
}
|
}
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return localActiveIndex !== null && <Timeline page={route.key} />
|
||||||
(localActiveIndex !== null || route.key === 'RemotePublic') && (
|
|
||||||
<Timeline page={route.key} />
|
|
||||||
)
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
[localActiveIndex]
|
[localActiveIndex]
|
||||||
)
|
)
|
||||||
|
@ -70,21 +49,12 @@ const Timelines: React.FC<Props> = ({ name }) => {
|
||||||
const { mode } = useTheme()
|
const { mode } = useTheme()
|
||||||
const [segment, setSegment] = useState(0)
|
const [segment, setSegment] = useState(0)
|
||||||
const screenOptions = useMemo(() => {
|
const screenOptions = useMemo(() => {
|
||||||
if (localActiveIndex === null) {
|
if (localActiveIndex !== null) {
|
||||||
if (name === 'Public') {
|
|
||||||
return {
|
|
||||||
headerTitle: remoteUrl,
|
|
||||||
...(Platform.OS === 'android' && {
|
|
||||||
headerCenter: () => <HeaderCenter content={remoteUrl} />
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return {
|
return {
|
||||||
headerCenter: () => (
|
headerCenter: () => (
|
||||||
<SegmentedControl
|
<SegmentedControl
|
||||||
appearance={mode}
|
appearance={mode}
|
||||||
values={mapNameToContent[name].map(p => p.title)}
|
values={pages.map(p => p.title)}
|
||||||
selectedIndex={segment}
|
selectedIndex={segment}
|
||||||
onChange={({ nativeEvent }) =>
|
onChange={({ nativeEvent }) =>
|
||||||
setSegment(nativeEvent.selectedSegmentIndex)
|
setSegment(nativeEvent.selectedSegmentIndex)
|
||||||
|
@ -105,11 +75,7 @@ const Timelines: React.FC<Props> = ({ name }) => {
|
||||||
<Stack.Navigator
|
<Stack.Navigator
|
||||||
screenOptions={{ headerHideShadow: true, headerTopInsetEnabled: false }}
|
screenOptions={{ headerHideShadow: true, headerTopInsetEnabled: false }}
|
||||||
>
|
>
|
||||||
<Stack.Screen
|
<Stack.Screen name='Screen-Remote-Root' options={screenOptions}>
|
||||||
// @ts-ignore
|
|
||||||
name={`Screen-${name}-Root`}
|
|
||||||
options={screenOptions}
|
|
||||||
>
|
|
||||||
{() => (
|
{() => (
|
||||||
<TabView
|
<TabView
|
||||||
lazy
|
lazy
|
||||||
|
@ -124,7 +90,7 @@ const Timelines: React.FC<Props> = ({ name }) => {
|
||||||
)}
|
)}
|
||||||
</Stack.Screen>
|
</Stack.Screen>
|
||||||
|
|
||||||
{sharedScreens(Stack)}
|
{sharedScreens(Stack as any)}
|
||||||
</Stack.Navigator>
|
</Stack.Navigator>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,7 @@ const TimelinePoll: React.FC<Props> = ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [poll.expired, poll.voted, allOptions, mutation.isLoading])
|
}, [mode, poll.expired, poll.voted, allOptions, mutation.isLoading])
|
||||||
|
|
||||||
const pollExpiration = useMemo(() => {
|
const pollExpiration = useMemo(() => {
|
||||||
if (poll.expired) {
|
if (poll.expired) {
|
||||||
|
|
|
@ -14,7 +14,6 @@ export default {
|
||||||
meLists: require('./screens/meLists').default,
|
meLists: require('./screens/meLists').default,
|
||||||
meListsList: require('./screens/meListsList').default,
|
meListsList: require('./screens/meListsList').default,
|
||||||
meSettings: require('./screens/meSettings').default,
|
meSettings: require('./screens/meSettings').default,
|
||||||
meSettingsUpdateRemote: require('./screens/meSettingsUpdateRemote').default,
|
|
||||||
meSwitch: require('./screens/meSwitch').default,
|
meSwitch: require('./screens/meSwitch').default,
|
||||||
|
|
||||||
sharedAccount: require('./screens/sharedAccount').default,
|
sharedAccount: require('./screens/sharedAccount').default,
|
||||||
|
|
|
@ -2,6 +2,7 @@ export default {
|
||||||
server: {
|
server: {
|
||||||
textInput: { placeholder: "Instance' domain" },
|
textInput: { placeholder: "Instance' domain" },
|
||||||
privateInstance: 'Private instance, peeping not allowed',
|
privateInstance: 'Private instance, peeping not allowed',
|
||||||
|
EULA: { base: 'I have read and agreed to ', EULA: 'EULA' },
|
||||||
button: {
|
button: {
|
||||||
local: 'Login',
|
local: 'Login',
|
||||||
remote: 'Peep'
|
remote: 'Peep'
|
||||||
|
@ -13,8 +14,11 @@ export default {
|
||||||
statuses: 'Toots',
|
statuses: 'Toots',
|
||||||
domains: 'Universes'
|
domains: 'Universes'
|
||||||
},
|
},
|
||||||
disclaimer:
|
disclaimer: {
|
||||||
"Logging in process uses system broswer that, your account informationo won't be visible to tooot app. Read more at: "
|
base:
|
||||||
|
"Logging in process uses system broswer that, your account informationo won't be visible to tooot app. Read more ",
|
||||||
|
privacy: 'privacy policy'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
update: {
|
update: {
|
||||||
local: {
|
local: {
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
export default {
|
export default {
|
||||||
heading: {
|
heading: 'Following'
|
||||||
segments: {
|
|
||||||
left: 'Following',
|
|
||||||
right: 'Local'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
export default {
|
|
||||||
heading: 'Register external instance'
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@ export default {
|
||||||
heading: {
|
heading: {
|
||||||
segments: {
|
segments: {
|
||||||
left: 'Federated',
|
left: 'Federated',
|
||||||
right: 'External'
|
right: 'Local'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ export default {
|
||||||
meLists: require('./screens/meLists').default,
|
meLists: require('./screens/meLists').default,
|
||||||
meListsList: require('./screens/meListsList').default,
|
meListsList: require('./screens/meListsList').default,
|
||||||
meSettings: require('./screens/meSettings').default,
|
meSettings: require('./screens/meSettings').default,
|
||||||
meSettingsUpdateRemote: require('./screens/meSettingsUpdateRemote').default,
|
|
||||||
meSwitch: require('./screens/meSwitch').default,
|
meSwitch: require('./screens/meSwitch').default,
|
||||||
|
|
||||||
sharedAccount: require('./screens/sharedAccount').default,
|
sharedAccount: require('./screens/sharedAccount').default,
|
||||||
|
|
|
@ -2,6 +2,7 @@ export default {
|
||||||
server: {
|
server: {
|
||||||
textInput: { placeholder: '输入社区服务器地址' },
|
textInput: { placeholder: '输入社区服务器地址' },
|
||||||
privateInstance: '非公开社区, 不能围观',
|
privateInstance: '非公开社区, 不能围观',
|
||||||
|
EULA: { base: '我阅读并同意 ', EULA: '最终用户条款' },
|
||||||
button: {
|
button: {
|
||||||
local: '登录',
|
local: '登录',
|
||||||
remote: '围观'
|
remote: '围观'
|
||||||
|
@ -13,8 +14,11 @@ export default {
|
||||||
statuses: '嘟文总数',
|
statuses: '嘟文总数',
|
||||||
domains: '连结总数'
|
domains: '连结总数'
|
||||||
},
|
},
|
||||||
disclaimer:
|
disclaimer: {
|
||||||
'登录过程将使用系统浏览器,你的账号登录信息tooot应用无法读取。详见:'
|
base:
|
||||||
|
'登录过程将使用系统浏览器,你的账号登录信息tooot应用无法读取。详见 ',
|
||||||
|
privacy: '隐私条款'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
update: {
|
update: {
|
||||||
local: {
|
local: {
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
export default {
|
export default {
|
||||||
heading: {
|
heading: '我的关注'
|
||||||
segments: {
|
|
||||||
left: '我的关注',
|
|
||||||
right: '本站嘟嘟'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
export default {
|
|
||||||
heading: '围观社区'
|
|
||||||
}
|
|
|
@ -2,7 +2,7 @@ export default {
|
||||||
heading: {
|
heading: {
|
||||||
segments: {
|
segments: {
|
||||||
left: '跨站嘟嘟',
|
left: '跨站嘟嘟',
|
||||||
right: '外站嘟嘟'
|
right: '本站嘟嘟'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,52 @@
|
||||||
import Timelines from '@components/Timelines'
|
import analytics from '@components/analytics'
|
||||||
import React from 'react'
|
import { HeaderCenter, HeaderRight } from '@components/Header'
|
||||||
|
import Timeline from '@components/Timelines/Timeline'
|
||||||
|
import { useNavigation } from '@react-navigation/native'
|
||||||
|
import { getLocalActiveIndex } from '@utils/slices/instancesSlice'
|
||||||
|
import React, { useCallback } from 'react'
|
||||||
|
import { useTranslation } from 'react-i18next'
|
||||||
|
import { Platform } from 'react-native'
|
||||||
|
import { createNativeStackNavigator } from 'react-native-screens/native-stack'
|
||||||
|
import { useSelector } from 'react-redux'
|
||||||
|
import sharedScreens from './Shared/sharedScreens'
|
||||||
|
|
||||||
|
const Stack = createNativeStackNavigator<Nav.LocalStackParamList>()
|
||||||
|
|
||||||
const ScreenLocal = React.memo(
|
const ScreenLocal = React.memo(
|
||||||
() => {
|
() => {
|
||||||
return <Timelines name='Local' />
|
const { t } = useTranslation('local')
|
||||||
|
const navigation = useNavigation()
|
||||||
|
const localActiveIndex = useSelector(getLocalActiveIndex)
|
||||||
|
|
||||||
|
const onPressSearch = useCallback(() => {
|
||||||
|
analytics('search_tap', { page: 'Local' })
|
||||||
|
navigation.navigate('Screen-Local', { screen: 'Screen-Shared-Search' })
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Stack.Navigator
|
||||||
|
screenOptions={{
|
||||||
|
headerLeft: () => null,
|
||||||
|
headerRight: () => (
|
||||||
|
<HeaderRight content='Search' onPress={onPressSearch} />
|
||||||
|
),
|
||||||
|
headerTitle: t('heading'),
|
||||||
|
...(Platform.OS === 'android' && {
|
||||||
|
headerCenter: () => <HeaderCenter content={t('heading')} />
|
||||||
|
}),
|
||||||
|
headerHideShadow: true,
|
||||||
|
headerTopInsetEnabled: false
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Stack.Screen name='Screen-Local-Root'>
|
||||||
|
{() =>
|
||||||
|
localActiveIndex !== null ? <Timeline page='Following' /> : null
|
||||||
|
}
|
||||||
|
</Stack.Screen>
|
||||||
|
|
||||||
|
{sharedScreens(Stack as any)}
|
||||||
|
</Stack.Navigator>
|
||||||
|
)
|
||||||
},
|
},
|
||||||
() => true
|
() => true
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,7 +7,6 @@ import ScreenMeRoot from '@screens/Me/Root'
|
||||||
import ScreenMeListsList from '@screens/Me/Root/Lists/List'
|
import ScreenMeListsList from '@screens/Me/Root/Lists/List'
|
||||||
import ScreenMeSettings from '@screens/Me/Settings'
|
import ScreenMeSettings from '@screens/Me/Settings'
|
||||||
import ScreenMeSwitch from '@screens/Me/Switch'
|
import ScreenMeSwitch from '@screens/Me/Switch'
|
||||||
import ScreenMeUpdateRemote from '@screens/Me/UpdateRemote'
|
|
||||||
import sharedScreens from '@screens/Shared/sharedScreens'
|
import sharedScreens from '@screens/Shared/sharedScreens'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
@ -110,19 +109,6 @@ const ScreenMe: React.FC = () => {
|
||||||
headerLeft: () => <HeaderLeft onPress={() => navigation.pop(1)} />
|
headerLeft: () => <HeaderLeft onPress={() => navigation.pop(1)} />
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
|
||||||
name='Screen-Me-Settings-UpdateRemote'
|
|
||||||
component={ScreenMeUpdateRemote}
|
|
||||||
options={({ navigation }: any) => ({
|
|
||||||
headerTitle: t('meSettingsUpdateRemote:heading'),
|
|
||||||
...(Platform.OS === 'android' && {
|
|
||||||
headerCenter: () => (
|
|
||||||
<HeaderCenter content={t('meSettingsUpdateRemote:heading')} />
|
|
||||||
)
|
|
||||||
}),
|
|
||||||
headerLeft: () => <HeaderLeft onPress={() => navigation.pop(1)} />
|
|
||||||
})}
|
|
||||||
/>
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name='Screen-Me-Switch'
|
name='Screen-Me-Switch'
|
||||||
component={ScreenMeSwitch}
|
component={ScreenMeSwitch}
|
||||||
|
|
|
@ -4,12 +4,10 @@ import haptics from '@components/haptics'
|
||||||
import Icon from '@components/Icon'
|
import Icon from '@components/Icon'
|
||||||
import { MenuContainer, MenuRow } from '@components/Menu'
|
import { MenuContainer, MenuRow } from '@components/Menu'
|
||||||
import { useActionSheet } from '@expo/react-native-action-sheet'
|
import { useActionSheet } from '@expo/react-native-action-sheet'
|
||||||
import { useNavigation } from '@react-navigation/native'
|
|
||||||
import { persistor } from '@root/store'
|
import { persistor } from '@root/store'
|
||||||
import {
|
import {
|
||||||
getLocalActiveIndex,
|
getLocalActiveIndex,
|
||||||
getLocalInstances,
|
getLocalInstances
|
||||||
getRemoteUrl
|
|
||||||
} from '@utils/slices/instancesSlice'
|
} from '@utils/slices/instancesSlice'
|
||||||
import {
|
import {
|
||||||
changeAnalytics,
|
changeAnalytics,
|
||||||
|
@ -92,13 +90,11 @@ const DevDebug: React.FC = () => {
|
||||||
|
|
||||||
const ScreenMeSettings: React.FC = () => {
|
const ScreenMeSettings: React.FC = () => {
|
||||||
const { showActionSheetWithOptions } = useActionSheet()
|
const { showActionSheetWithOptions } = useActionSheet()
|
||||||
const navigation = useNavigation()
|
|
||||||
const { t, i18n } = useTranslation('meSettings')
|
const { t, i18n } = useTranslation('meSettings')
|
||||||
const { setTheme, theme } = useTheme()
|
const { setTheme, theme } = useTheme()
|
||||||
const settingsLanguage = useSelector(getSettingsLanguage)
|
const settingsLanguage = useSelector(getSettingsLanguage)
|
||||||
const settingsTheme = useSelector(getSettingsTheme)
|
const settingsTheme = useSelector(getSettingsTheme)
|
||||||
const settingsBrowser = useSelector(getSettingsBrowser)
|
const settingsBrowser = useSelector(getSettingsBrowser)
|
||||||
const settingsRemote = useSelector(getRemoteUrl)
|
|
||||||
const settingsAnalytics = useSelector(getSettingsAnalytics)
|
const settingsAnalytics = useSelector(getSettingsAnalytics)
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
|
@ -232,13 +228,6 @@ const ScreenMeSettings: React.FC = () => {
|
||||||
/>
|
/>
|
||||||
</MenuContainer>
|
</MenuContainer>
|
||||||
<MenuContainer>
|
<MenuContainer>
|
||||||
<MenuRow
|
|
||||||
title={t('content.remote.heading')}
|
|
||||||
description={t('content.remote.description')}
|
|
||||||
content={settingsRemote}
|
|
||||||
iconBack='ChevronRight'
|
|
||||||
onPress={() => navigation.navigate('Screen-Me-Settings-UpdateRemote')}
|
|
||||||
/>
|
|
||||||
<MenuRow
|
<MenuRow
|
||||||
title={t('content.cache.heading')}
|
title={t('content.cache.heading')}
|
||||||
content={
|
content={
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
import ComponentInstance from '@components/Instance'
|
|
||||||
import React from 'react'
|
|
||||||
import { KeyboardAvoidingView, Platform } from 'react-native'
|
|
||||||
import { ScrollView } from 'react-native-gesture-handler'
|
|
||||||
|
|
||||||
const ScreenMeUpdateRemote: React.FC = () => {
|
|
||||||
return (
|
|
||||||
<KeyboardAvoidingView
|
|
||||||
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
|
||||||
style={{ flex: 1 }}
|
|
||||||
>
|
|
||||||
<ScrollView keyboardShouldPersistTaps='handled'>
|
|
||||||
<ComponentInstance type='remote' disableHeaderImage />
|
|
||||||
</ScrollView>
|
|
||||||
</KeyboardAvoidingView>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ScreenMeUpdateRemote
|
|
|
@ -3,7 +3,7 @@ import React from 'react'
|
||||||
|
|
||||||
const ScreenPublic = React.memo(
|
const ScreenPublic = React.memo(
|
||||||
() => {
|
() => {
|
||||||
return <Timelines name='Public' />
|
return <Timelines />
|
||||||
},
|
},
|
||||||
() => true
|
() => true
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue