mirror of https://github.com/tooot-app/app
Fixed #463
This commit is contained in:
parent
aa5ad5cd4e
commit
5907d43eb2
|
@ -167,7 +167,10 @@ const ScreenCompose: React.FC<RootStackScreenProps<'Screen-Compose'>> = ({
|
||||||
formatText({
|
formatText({
|
||||||
textInput: 'text',
|
textInput: 'text',
|
||||||
composeDispatch,
|
composeDispatch,
|
||||||
content: params.accts.map(acct => `@${acct}`).join(' ') + ' ',
|
content:
|
||||||
|
(params.text && `${params.text}\n`) +
|
||||||
|
params.accts.map(acct => `@${acct}`).join(' ') +
|
||||||
|
' ',
|
||||||
disableDebounce: true
|
disableDebounce: true
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
|
|
|
@ -10,8 +10,11 @@ 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'
|
import { useSelector } from 'react-redux'
|
||||||
import { getInstanceActive } from '@utils/slices/instancesSlice'
|
import { getInstanceActive, getInstanceVersion } from '@utils/slices/instancesSlice'
|
||||||
import { isDevelopment, isRelease } from '@utils/checkEnvironment'
|
import { isDevelopment, isRelease } from '@utils/checkEnvironment'
|
||||||
|
import { Platform } from 'react-native'
|
||||||
|
import Constants from 'expo-constants'
|
||||||
|
import { getExpoToken } from '@utils/slices/appSlice'
|
||||||
|
|
||||||
const SettingsTooot: React.FC = () => {
|
const SettingsTooot: React.FC = () => {
|
||||||
const instanceActive = useSelector(getInstanceActive)
|
const instanceActive = useSelector(getInstanceActive)
|
||||||
|
@ -19,16 +22,15 @@ const SettingsTooot: React.FC = () => {
|
||||||
const { colors } = useTheme()
|
const { colors } = useTheme()
|
||||||
const { t } = useTranslation('screenTabs')
|
const { t } = useTranslation('screenTabs')
|
||||||
|
|
||||||
|
const instanceVersion = useSelector(getInstanceVersion, () => true)
|
||||||
|
const expoToken = useSelector(getExpoToken)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MenuContainer>
|
<MenuContainer>
|
||||||
<MenuRow
|
<MenuRow
|
||||||
title={t('me.settings.feedback.heading')}
|
title={t('me.settings.feedback.heading')}
|
||||||
content={
|
content={
|
||||||
<Icon
|
<Icon name='MessageSquare' size={StyleConstants.Font.Size.M} color={colors.secondary} />
|
||||||
name='MessageSquare'
|
|
||||||
size={StyleConstants.Font.Size.M}
|
|
||||||
color={colors.secondary}
|
|
||||||
/>
|
|
||||||
}
|
}
|
||||||
iconBack='ChevronRight'
|
iconBack='ChevronRight'
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
|
@ -38,13 +40,7 @@ const SettingsTooot: React.FC = () => {
|
||||||
/>
|
/>
|
||||||
<MenuRow
|
<MenuRow
|
||||||
title={t('me.settings.support.heading')}
|
title={t('me.settings.support.heading')}
|
||||||
content={
|
content={<Icon name='Heart' size={StyleConstants.Font.Size.M} color={colors.red} />}
|
||||||
<Icon
|
|
||||||
name='Heart'
|
|
||||||
size={StyleConstants.Font.Size.M}
|
|
||||||
color={colors.red}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
iconBack='ChevronRight'
|
iconBack='ChevronRight'
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
analytics('settings_support_press')
|
analytics('settings_support_press')
|
||||||
|
@ -54,37 +50,35 @@ const SettingsTooot: React.FC = () => {
|
||||||
{isDevelopment || isRelease ? (
|
{isDevelopment || isRelease ? (
|
||||||
<MenuRow
|
<MenuRow
|
||||||
title={t('me.settings.review.heading')}
|
title={t('me.settings.review.heading')}
|
||||||
content={
|
content={<Icon name='Star' size={StyleConstants.Font.Size.M} color='#FF9500' />}
|
||||||
<Icon
|
|
||||||
name='Star'
|
|
||||||
size={StyleConstants.Font.Size.M}
|
|
||||||
color='#FF9500'
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
iconBack='ChevronRight'
|
iconBack='ChevronRight'
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
analytics('settings_review_press')
|
analytics('settings_review_press')
|
||||||
StoreReview?.isAvailableAsync().then(() =>
|
StoreReview?.isAvailableAsync().then(() => StoreReview?.requestReview())
|
||||||
StoreReview?.requestReview()
|
|
||||||
)
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
<MenuRow
|
<MenuRow
|
||||||
title={t('me.settings.contact.heading')}
|
title={t('me.settings.contact.heading')}
|
||||||
content={
|
content={<Icon name='Mail' size={StyleConstants.Font.Size.M} color={colors.secondary} />}
|
||||||
<Icon
|
|
||||||
name='Mail'
|
|
||||||
size={StyleConstants.Font.Size.M}
|
|
||||||
color={colors.secondary}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
iconBack='ChevronRight'
|
iconBack='ChevronRight'
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
if (instanceActive !== -1) {
|
if (instanceActive !== -1) {
|
||||||
navigation.navigate('Screen-Compose', {
|
navigation.navigate('Screen-Compose', {
|
||||||
type: 'conversation',
|
type: 'conversation',
|
||||||
accts: ['tooot@xmflsct.com']
|
accts: ['tooot@xmflsct.com'],
|
||||||
|
text:
|
||||||
|
'[' +
|
||||||
|
`${Platform.OS}/${Platform.Version}` +
|
||||||
|
' - ' +
|
||||||
|
(Constants.expoConfig?.version ? `t/${Constants.expoConfig?.version}` : '') +
|
||||||
|
' - ' +
|
||||||
|
(instanceVersion ? `m/${instanceVersion}` : '') +
|
||||||
|
' - ' +
|
||||||
|
(expoToken
|
||||||
|
? `e/${expoToken.replace(/^ExponentPushToken\[/, '').replace(/\]$/, '')}`
|
||||||
|
: '') +
|
||||||
|
']'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
WebBrowser.openBrowserAsync('https://social.xmflsct.com/@tooot')
|
WebBrowser.openBrowserAsync('https://social.xmflsct.com/@tooot')
|
||||||
|
|
|
@ -38,6 +38,7 @@ export type RootStackParamList = {
|
||||||
| {
|
| {
|
||||||
type: 'conversation'
|
type: 'conversation'
|
||||||
accts: Mastodon.Account['acct'][]
|
accts: Mastodon.Account['acct'][]
|
||||||
|
text?: string // For contacting tooot only
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: 'share'
|
type: 'share'
|
||||||
|
|
|
@ -9,7 +9,7 @@ export const retrieveExpoToken = createAsyncThunk(
|
||||||
'app/expoToken',
|
'app/expoToken',
|
||||||
async (): Promise<string> => {
|
async (): Promise<string> => {
|
||||||
if (isDevelopment) {
|
if (isDevelopment) {
|
||||||
return 'DEVELOPMENT_TOKEN_1'
|
return 'ExponentPushToken[DEVELOPMENT_1]'
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await Notifications.getExpoPushTokenAsync({
|
const res = await Notifications.getExpoPushTokenAsync({
|
||||||
|
|
Loading…
Reference in New Issue