This commit is contained in:
xmflsct 2022-11-17 21:48:22 +01:00
parent aa5ad5cd4e
commit 5907d43eb2
4 changed files with 31 additions and 33 deletions

View File

@ -167,7 +167,10 @@ const ScreenCompose: React.FC<RootStackScreenProps<'Screen-Compose'>> = ({
formatText({
textInput: 'text',
composeDispatch,
content: params.accts.map(acct => `@${acct}`).join(' ') + ' ',
content:
(params.text && `${params.text}\n`) +
params.accts.map(acct => `@${acct}`).join(' ') +
' ',
disableDebounce: true
})
break

View File

@ -10,8 +10,11 @@ import * as WebBrowser from 'expo-web-browser'
import React from 'react'
import { useTranslation } from 'react-i18next'
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 { Platform } from 'react-native'
import Constants from 'expo-constants'
import { getExpoToken } from '@utils/slices/appSlice'
const SettingsTooot: React.FC = () => {
const instanceActive = useSelector(getInstanceActive)
@ -19,16 +22,15 @@ const SettingsTooot: React.FC = () => {
const { colors } = useTheme()
const { t } = useTranslation('screenTabs')
const instanceVersion = useSelector(getInstanceVersion, () => true)
const expoToken = useSelector(getExpoToken)
return (
<MenuContainer>
<MenuRow
title={t('me.settings.feedback.heading')}
content={
<Icon
name='MessageSquare'
size={StyleConstants.Font.Size.M}
color={colors.secondary}
/>
<Icon name='MessageSquare' size={StyleConstants.Font.Size.M} color={colors.secondary} />
}
iconBack='ChevronRight'
onPress={() => {
@ -38,13 +40,7 @@ const SettingsTooot: React.FC = () => {
/>
<MenuRow
title={t('me.settings.support.heading')}
content={
<Icon
name='Heart'
size={StyleConstants.Font.Size.M}
color={colors.red}
/>
}
content={<Icon name='Heart' size={StyleConstants.Font.Size.M} color={colors.red} />}
iconBack='ChevronRight'
onPress={() => {
analytics('settings_support_press')
@ -54,37 +50,35 @@ const SettingsTooot: React.FC = () => {
{isDevelopment || isRelease ? (
<MenuRow
title={t('me.settings.review.heading')}
content={
<Icon
name='Star'
size={StyleConstants.Font.Size.M}
color='#FF9500'
/>
}
content={<Icon name='Star' size={StyleConstants.Font.Size.M} color='#FF9500' />}
iconBack='ChevronRight'
onPress={() => {
analytics('settings_review_press')
StoreReview?.isAvailableAsync().then(() =>
StoreReview?.requestReview()
)
StoreReview?.isAvailableAsync().then(() => StoreReview?.requestReview())
}}
/>
) : null}
<MenuRow
title={t('me.settings.contact.heading')}
content={
<Icon
name='Mail'
size={StyleConstants.Font.Size.M}
color={colors.secondary}
/>
}
content={<Icon name='Mail' size={StyleConstants.Font.Size.M} color={colors.secondary} />}
iconBack='ChevronRight'
onPress={() => {
if (instanceActive !== -1) {
navigation.navigate('Screen-Compose', {
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 {
WebBrowser.openBrowserAsync('https://social.xmflsct.com/@tooot')

View File

@ -38,6 +38,7 @@ export type RootStackParamList = {
| {
type: 'conversation'
accts: Mastodon.Account['acct'][]
text?: string // For contacting tooot only
}
| {
type: 'share'

View File

@ -9,7 +9,7 @@ export const retrieveExpoToken = createAsyncThunk(
'app/expoToken',
async (): Promise<string> => {
if (isDevelopment) {
return 'DEVELOPMENT_TOKEN_1'
return 'ExponentPushToken[DEVELOPMENT_1]'
}
const res = await Notifications.getExpoPushTokenAsync({