Fixing redesign-settings prettier & lint => CI
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Center, Flex, Heading } from 'native-base';
|
||||
import { translate, Translate } from '../../i18n/i18n';
|
||||
import { Flex } from 'native-base';
|
||||
import { translate } from '../../i18n/i18n';
|
||||
import ElementList from '../../components/GtkUI/ElementList';
|
||||
import useUserSettings from '../../hooks/userSettings';
|
||||
import { LoadingView } from '../../components/Loading';
|
||||
|
||||
@@ -1,22 +1,13 @@
|
||||
import React from 'react';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { Center, Flex, Heading } from 'native-base';
|
||||
import { Flex } from 'native-base';
|
||||
import { useLanguage } from '../../state/LanguageSlice';
|
||||
import { AvailableLanguages, DefaultLanguage, translate, Translate } from '../../i18n/i18n';
|
||||
import { AvailableLanguages, DefaultLanguage, translate } from '../../i18n/i18n';
|
||||
import { useSelector } from '../../state/Store';
|
||||
import { updateSettings } from '../../state/SettingsSlice';
|
||||
import ElementList from '../../components/GtkUI/ElementList';
|
||||
import LocalSettings from '../../models/LocalSettings';
|
||||
import {
|
||||
Brush,
|
||||
Brush2,
|
||||
Colorfilter,
|
||||
LanguageSquare,
|
||||
Rank,
|
||||
Ranking,
|
||||
Sound,
|
||||
Star1,
|
||||
} from 'iconsax-react-native';
|
||||
import { Brush2, Colorfilter, LanguageSquare, Rank, Sound } from 'iconsax-react-native';
|
||||
|
||||
const PreferencesView = () => {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Center, Flex, Heading } from 'native-base';
|
||||
import { Flex } from 'native-base';
|
||||
import { translate } from '../../i18n/i18n';
|
||||
import ElementList from '../../components/GtkUI/ElementList';
|
||||
import { useDispatch } from 'react-redux';
|
||||
@@ -7,7 +7,7 @@ import { RootState, useSelector } from '../../state/Store';
|
||||
import { updateSettings } from '../../state/SettingsSlice';
|
||||
import useUserSettings from '../../hooks/userSettings';
|
||||
import { LoadingView } from '../../components/Loading';
|
||||
import { Driver, Driver2, Like1, Shop } from 'iconsax-react-native';
|
||||
import { Driver, Like1, Shop } from 'iconsax-react-native';
|
||||
|
||||
const PrivacyView = () => {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
@@ -1,32 +1,16 @@
|
||||
import API from '../../API';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { unsetAccessToken } from '../../state/UserSlice';
|
||||
import React from 'react';
|
||||
import { Column, Text, Button, Box, Flex, Center, Heading, Popover, Toast } from 'native-base';
|
||||
import TextButton from '../../components/TextButton';
|
||||
import { Flex } from 'native-base';
|
||||
import { LoadingView } from '../../components/Loading';
|
||||
import ElementList from '../../components/GtkUI/ElementList';
|
||||
import { translate } from '../../i18n/i18n';
|
||||
import { useQuery } from '../../Queries';
|
||||
import UserAvatar from '../../components/UserAvatar';
|
||||
import * as ImagePicker from 'expo-image-picker';
|
||||
import SettingBase from '../../components/UI/SettingsBase';
|
||||
import {
|
||||
Designtools,
|
||||
Google,
|
||||
Magicpen,
|
||||
PasswordCheck,
|
||||
SmsEdit,
|
||||
Star1,
|
||||
UserSquare,
|
||||
} from 'iconsax-react-native';
|
||||
import { LinearGradient } from 'expo-linear-gradient';
|
||||
import { Designtools, Magicpen, Star1 } from 'iconsax-react-native';
|
||||
|
||||
// Too painful to infer the settings-only, typed navigator. Gave up
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const PremiumSettings = () => {
|
||||
const userQuery = useQuery(API.getUserInfo);
|
||||
const dispatch = useDispatch();
|
||||
|
||||
if (!userQuery.data || userQuery.isLoading) {
|
||||
return <LoadingView />;
|
||||
|
||||
@@ -1,40 +1,12 @@
|
||||
import API from '../../API';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { unsetAccessToken } from '../../state/UserSlice';
|
||||
import React from 'react';
|
||||
import {
|
||||
Column,
|
||||
Text,
|
||||
Button,
|
||||
Box,
|
||||
Flex,
|
||||
Center,
|
||||
Heading,
|
||||
Popover,
|
||||
Toast,
|
||||
View,
|
||||
} from 'native-base';
|
||||
import TextButton from '../../components/TextButton';
|
||||
import { Flex, Toast } from 'native-base';
|
||||
import { LoadingView } from '../../components/Loading';
|
||||
import ElementList from '../../components/GtkUI/ElementList';
|
||||
import { translate } from '../../i18n/i18n';
|
||||
import { useQuery } from '../../Queries';
|
||||
import UserAvatar from '../../components/UserAvatar';
|
||||
import * as ImagePicker from 'expo-image-picker';
|
||||
import SettingBase from '../../components/UI/SettingsBase';
|
||||
import {
|
||||
ArrowDown2,
|
||||
EyeSlash,
|
||||
Google,
|
||||
Lock1,
|
||||
PasswordCheck,
|
||||
Sms,
|
||||
SmsEdit,
|
||||
UserSquare,
|
||||
} from 'iconsax-react-native';
|
||||
import { LinearGradient } from 'expo-linear-gradient';
|
||||
import TextFormField from '../../components/UI/TextFormField';
|
||||
import ButtonBase from '../../components/UI/ButtonBase';
|
||||
import { Google, PasswordCheck, SmsEdit, UserSquare } from 'iconsax-react-native';
|
||||
import ChangeEmailForm from '../../components/forms/changeEmailForm';
|
||||
import ChangePasswordForm from '../../components/forms/changePasswordForm';
|
||||
|
||||
@@ -52,7 +24,6 @@ const handleChangePassword = async (oldPassword: string, newPassword: string): P
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const ProfileSettings = () => {
|
||||
const userQuery = useQuery(API.getUserInfo);
|
||||
const dispatch = useDispatch();
|
||||
|
||||
if (!userQuery.data || userQuery.isLoading) {
|
||||
return <LoadingView />;
|
||||
@@ -126,6 +97,7 @@ const ProfileSettings = () => {
|
||||
value: true,
|
||||
section: [
|
||||
<ChangePasswordForm
|
||||
key={'ChangePasswordForm'}
|
||||
onSubmit={(oldPassword, newPassword) =>
|
||||
handleChangePassword(oldPassword, newPassword)
|
||||
}
|
||||
@@ -143,6 +115,7 @@ const ProfileSettings = () => {
|
||||
value: true,
|
||||
section: [
|
||||
<ChangeEmailForm
|
||||
key={'ChangeEmailForm'}
|
||||
onSubmit={(oldEmail, newEmail) => handleChangeEmail(newEmail)}
|
||||
/>,
|
||||
],
|
||||
|
||||
@@ -1,26 +1,10 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import { Center, Text, Heading, Box, Row } from 'native-base';
|
||||
import { translate } from '../../i18n/i18n';
|
||||
import createTabRowNavigator from '../../components/navigators/TabRowNavigator';
|
||||
import { MaterialCommunityIcons, FontAwesome5 } from '@expo/vector-icons';
|
||||
import ChangePasswordForm from '../../components/forms/changePasswordForm';
|
||||
import ChangeEmailForm from '../../components/forms/changeEmailForm';
|
||||
import React from 'react';
|
||||
import { Center, Text } from 'native-base';
|
||||
import ProfileSettings from './SettingsProfileView';
|
||||
import NotificationsView from './NotificationView';
|
||||
import PrivacyView from './PrivacyView';
|
||||
import PreferencesView from './PreferencesView';
|
||||
import GuestToUserView from './GuestToUserView';
|
||||
import { useQuery } from '../../Queries';
|
||||
import API from '../../API';
|
||||
import { RouteProps } from '../../Navigation';
|
||||
import {
|
||||
PressableAndroidRippleConfig,
|
||||
StyleProp,
|
||||
TextStyle,
|
||||
View,
|
||||
ViewStyle,
|
||||
useWindowDimensions,
|
||||
} from 'react-native';
|
||||
import { View, useWindowDimensions } from 'react-native';
|
||||
import {
|
||||
TabView,
|
||||
SceneMap,
|
||||
@@ -28,8 +12,6 @@ import {
|
||||
NavigationState,
|
||||
Route,
|
||||
SceneRendererProps,
|
||||
TabBarIndicatorProps,
|
||||
TabBarItemProps,
|
||||
} from 'react-native-tab-view';
|
||||
import {
|
||||
HeartEdit,
|
||||
@@ -40,7 +22,7 @@ import {
|
||||
Music,
|
||||
FolderCross,
|
||||
} from 'iconsax-react-native';
|
||||
import { Scene, Event } from 'react-native-tab-view/lib/typescript/src/types';
|
||||
import { Scene } from 'react-native-tab-view/lib/typescript/src/types';
|
||||
import { LinearGradient } from 'expo-linear-gradient';
|
||||
import PremiumSettings from './SettingsPremiumView';
|
||||
|
||||
@@ -94,50 +76,7 @@ const SetttingsNavigator = () => {
|
||||
]);
|
||||
|
||||
const renderTabBar = (
|
||||
props: JSX.IntrinsicAttributes &
|
||||
SceneRendererProps & {
|
||||
navigationState: NavigationState<Route>;
|
||||
scrollEnabled?: boolean | undefined;
|
||||
bounces?: boolean | undefined;
|
||||
activeColor?: string | undefined;
|
||||
inactiveColor?: string | undefined;
|
||||
pressColor?: string | undefined;
|
||||
pressOpacity?: number | undefined;
|
||||
getLabelText?: ((scene: Scene<Route>) => string | undefined) | undefined;
|
||||
getAccessible?: ((scene: Scene<Route>) => boolean | undefined) | undefined;
|
||||
getAccessibilityLabel?: ((scene: Scene<Route>) => string | undefined) | undefined;
|
||||
getTestID?: ((scene: Scene<Route>) => string | undefined) | undefined;
|
||||
renderLabel?:
|
||||
| ((
|
||||
scene: Scene<Route> & { focused: boolean; color: string }
|
||||
) => React.ReactNode)
|
||||
| undefined;
|
||||
renderIcon?:
|
||||
| ((
|
||||
scene: Scene<Route> & { focused: boolean; color: string }
|
||||
) => React.ReactNode)
|
||||
| undefined;
|
||||
renderBadge?: ((scene: Scene<Route>) => React.ReactNode) | undefined;
|
||||
renderIndicator?:
|
||||
| ((props: TabBarIndicatorProps<Route>) => React.ReactNode)
|
||||
| undefined;
|
||||
renderTabBarItem?:
|
||||
| ((
|
||||
props: TabBarItemProps<Route> & { key: string }
|
||||
) => React.ReactElement<any, string | React.JSXElementConstructor<any>>)
|
||||
| undefined;
|
||||
onTabPress?: ((scene: Scene<Route> & Event) => void) | undefined;
|
||||
onTabLongPress?: ((scene: Scene<Route>) => void) | undefined;
|
||||
tabStyle?: StyleProp<ViewStyle>;
|
||||
indicatorStyle?: StyleProp<ViewStyle>;
|
||||
indicatorContainerStyle?: StyleProp<ViewStyle>;
|
||||
labelStyle?: StyleProp<TextStyle>;
|
||||
contentContainerStyle?: StyleProp<ViewStyle>;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
gap?: number | undefined;
|
||||
testID?: string | undefined;
|
||||
android_ripple?: PressableAndroidRippleConfig | undefined;
|
||||
}
|
||||
props: SceneRendererProps & { navigationState: NavigationState<Route> }
|
||||
) => (
|
||||
<TabBar
|
||||
{...props}
|
||||
@@ -160,7 +99,7 @@ const SetttingsNavigator = () => {
|
||||
<tabHeader.icon size="18" color="#6075F9" />
|
||||
);
|
||||
}}
|
||||
renderLabel={({ route, focused, color }) =>
|
||||
renderLabel={({ route, color }) =>
|
||||
layout.width > 750 ? (
|
||||
<Text style={{ color, paddingLeft: 10, overflow: 'hidden' }}>
|
||||
{route.title}
|
||||
|
||||
Reference in New Issue
Block a user