-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from simonyiszk/major-improvements
Major improvements
- Loading branch information
Showing
10 changed files
with
117 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import Constants from 'expo-constants'; | ||
import * as Updates from 'expo-updates'; | ||
import React, { useEffect, useMemo, useState } from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { Platform, View } from 'react-native'; | ||
|
||
import { MessagingService } from '../../services/messaging.service'; | ||
import { StyledText } from '../base/text'; | ||
|
||
export function AppDetails() { | ||
const [userId, setUserId] = useState<string | null>(null); | ||
const appVersion = useMemo(() => { | ||
const update = Updates.updateId ?? '?'; | ||
const appVersion = Constants.expoConfig?.version ?? '?'; | ||
const versionCode = | ||
Platform.OS === 'android' ? Constants.expoConfig?.android?.versionCode : Constants.expoConfig?.ios?.buildNumber; | ||
return `${appVersion} (${versionCode ?? '?'}) - ${update}`; | ||
}, []); | ||
|
||
const appName = Constants.expoConfig?.name ?? 'App'; | ||
|
||
const { t } = useTranslation(); | ||
|
||
useEffect(() => { | ||
MessagingService.getUserId().then(setUserId); | ||
}, []); | ||
|
||
return ( | ||
<View className='items-center space-y-2'> | ||
<StyledText className='text-slate-500'>{appName}</StyledText> | ||
<StyledText className='text-slate-500'>{appVersion}</StyledText> | ||
<StyledText className='text-slate-500'>UID: {userId}</StyledText> | ||
<StyledText className='text-slate-500 text-center'>{t('settings.author')}</StyledText> | ||
<StyledText className='text-slate-500'>{new Date().getFullYear()}.</StyledText> | ||
</View> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { resources } from '../services/i18n_data'; | ||
|
||
declare module 'i18next' { | ||
interface CustomTypeOptions { | ||
fallbackLng: 'hu'; | ||
defaultNS: 'ns1'; | ||
resources: { | ||
ns1: typeof resources.hu.translation; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters