Front: First Pass on translations + remove unused setting tabs
This commit is contained in:
committed by
Clément Le Bihan
parent
00d097f643
commit
d3994ff26e
@@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Center, Text, useBreakpointValue, useTheme } from 'native-base';
|
||||
import { Text, useBreakpointValue, useTheme } from 'native-base';
|
||||
import ProfileSettings from './SettingsProfile';
|
||||
import NotificationsSettings from './NotificationsSettings';
|
||||
import PrivacySettings from './PrivacySettings';
|
||||
import PreferencesSettings from './PreferencesSettings';
|
||||
import { useWindowDimensions } from 'react-native';
|
||||
@@ -15,50 +14,32 @@ import {
|
||||
} from 'react-native-tab-view';
|
||||
import {
|
||||
HeartEdit,
|
||||
Star1,
|
||||
UserEdit,
|
||||
Notification,
|
||||
SecurityUser,
|
||||
Music,
|
||||
FolderCross,
|
||||
} from 'iconsax-react-native';
|
||||
import { Scene } from 'react-native-tab-view/lib/typescript/src/types';
|
||||
import PremiumSettings from './SettingsPremium';
|
||||
import { RouteProps } from '../../Navigation';
|
||||
import ScaffoldCC from '../../components/UI/ScaffoldCC';
|
||||
import { translate } from '../../i18n/i18n';
|
||||
|
||||
export const PianoSettings = () => {
|
||||
return (
|
||||
<Center style={{ flex: 1 }}>
|
||||
<Text>Global settings for the virtual piano</Text>
|
||||
</Center>
|
||||
);
|
||||
};
|
||||
|
||||
const renderScene = SceneMap({
|
||||
profile: ProfileSettings,
|
||||
premium: PremiumSettings,
|
||||
preferences: PreferencesSettings,
|
||||
notifications: NotificationsSettings,
|
||||
privacy: PrivacySettings,
|
||||
piano: PianoSettings,
|
||||
});
|
||||
|
||||
const getTabData = (key: string) => {
|
||||
switch (key) {
|
||||
case 'profile':
|
||||
return { index: 0, icon: UserEdit };
|
||||
case 'premium':
|
||||
return { index: 1, icon: Star1 };
|
||||
case 'preferences':
|
||||
return { index: 2, icon: HeartEdit };
|
||||
case 'notifications':
|
||||
return { index: 3, icon: Notification };
|
||||
case 'privacy':
|
||||
return { index: 4, icon: SecurityUser };
|
||||
case 'piano':
|
||||
return { index: 5, icon: Music };
|
||||
default:
|
||||
return { index: 6, icon: FolderCross };
|
||||
}
|
||||
@@ -71,11 +52,8 @@ const SettingsTab = (props: RouteProps<{}>) => {
|
||||
const { colors } = useTheme();
|
||||
const routes = [
|
||||
{ key: 'profile', title: 'settingsTabProfile' },
|
||||
{ key: 'premium', title: 'settingsTabPremium' },
|
||||
{ key: 'preferences', title: 'settingsTabPreferences' },
|
||||
{ key: 'notifications', title: 'settingsTabNotifications' },
|
||||
{ key: 'privacy', title: 'settingsTabPrivacy' },
|
||||
{ key: 'piano', title: 'settingsTabPiano' },
|
||||
];
|
||||
const screenSize = useBreakpointValue({ base: 'small', md: 'big' });
|
||||
const isSmallScreen = screenSize === 'small';
|
||||
@@ -113,11 +91,8 @@ const SettingsTab = (props: RouteProps<{}>) => {
|
||||
{translate(
|
||||
route.title as
|
||||
| 'settingsTabProfile'
|
||||
| 'settingsTabPremium'
|
||||
| 'settingsTabPreferences'
|
||||
| 'settingsTabNotifications'
|
||||
| 'settingsTabPrivacy'
|
||||
| 'settingsTabPiano'
|
||||
)}
|
||||
</Text>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user