forked from vergnet/application-amicale
feat: updated libs
This commit is contained in:
parent
6104b88815
commit
d5c6aa6b48
8 changed files with 21427 additions and 591 deletions
21680
package-lock.json
generated
21680
package-lock.json
generated
File diff suppressed because it is too large
Load diff
50
package.json
50
package.json
|
@ -20,13 +20,13 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@nartc/react-native-barcode-mask": "1.2.0",
|
||||
"@react-native-async-storage/async-storage": "1.15.5",
|
||||
"@react-native-async-storage/async-storage": "1.15.7",
|
||||
"@react-native-community/masked-view": "0.1.11",
|
||||
"@react-native-community/push-notification-ios": "1.8.0",
|
||||
"@react-native-community/slider": "3.0.3",
|
||||
"@react-navigation/bottom-tabs": "5.11.11",
|
||||
"@react-navigation/native": "5.9.4",
|
||||
"@react-navigation/stack": "5.14.5",
|
||||
"@react-native-community/push-notification-ios": "1.10.1",
|
||||
"@react-native-community/slider": "4.1.6",
|
||||
"@react-navigation/bottom-tabs": "6.0.5",
|
||||
"@react-navigation/native": "6.0.2",
|
||||
"@react-navigation/stack": "6.0.7",
|
||||
"i18n-js": "3.8.0",
|
||||
"moment": "2.29.1",
|
||||
"react": "17.0.2",
|
||||
|
@ -35,56 +35,56 @@
|
|||
"react-native-app-intro-slider": "4.0.4",
|
||||
"react-native-appearance": "0.3.4",
|
||||
"react-native-autolink": "4.0.0",
|
||||
"react-native-calendars": "1.1264.0",
|
||||
"react-native-camera": "3.44.3",
|
||||
"react-native-calendars": "1.1266.0",
|
||||
"react-native-camera": "4.1.1",
|
||||
"react-native-collapsible": "1.6.0",
|
||||
"react-native-gesture-handler": "1.10.3",
|
||||
"react-native-image-zoom-viewer": "3.0.1",
|
||||
"react-native-keychain": "4.0.5",
|
||||
"react-native-linear-gradient": "2.5.6",
|
||||
"react-native-localize": "2.1.1",
|
||||
"react-native-localize": "2.1.4",
|
||||
"react-native-modalize": "2.0.8",
|
||||
"react-native-paper": "4.9.2",
|
||||
"react-native-permissions": "3.0.5",
|
||||
"react-native-push-notification": "7.4.0",
|
||||
"react-native-push-notification": "8.1.0",
|
||||
"react-native-reanimated": "1.13.2",
|
||||
"react-native-render-html": "5.1.1",
|
||||
"react-native-safe-area-context": "3.2.0",
|
||||
"react-native-screens": "3.4.0",
|
||||
"react-native-safe-area-context": "3.3.2",
|
||||
"react-native-screens": "3.7.0",
|
||||
"react-native-splash-screen": "3.2.0",
|
||||
"react-native-timeago": "0.5.0",
|
||||
"react-native-vector-icons": "8.1.0",
|
||||
"react-native-webview": "11.6.5",
|
||||
"react-navigation-collapsible": "5.10.2",
|
||||
"react-navigation-header-buttons": "7.0.2"
|
||||
"react-native-webview": "11.13.0",
|
||||
"react-navigation-collapsible": "6.0.0",
|
||||
"react-navigation-header-buttons": "9.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.12.9",
|
||||
"@babel/runtime": "7.12.5",
|
||||
"@react-native-community/eslint-config": "3.0.0",
|
||||
"@react-native-community/eslint-config": "3.0.1",
|
||||
"@types/i18n-js": "3.8.2",
|
||||
"@types/jest": "26.0.24",
|
||||
"@types/react": "17.0.3",
|
||||
"@types/react-native": "0.64.12",
|
||||
"@types/react-native-calendars": "1.505.4",
|
||||
"@types/react-native-push-notification": "7.3.1",
|
||||
"@types/react-native": "0.65.0",
|
||||
"@types/react-native-calendars": "1.1264.2",
|
||||
"@types/react-native-push-notification": "7.3.2",
|
||||
"@types/react-native-vector-icons": "6.4.8",
|
||||
"@types/react-test-renderer": "17.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "4.28.3",
|
||||
"@typescript-eslint/parser": "4.28.3",
|
||||
"@typescript-eslint/eslint-plugin": "4.31.0",
|
||||
"@typescript-eslint/parser": "4.31.0",
|
||||
"babel-jest": "26.6.3",
|
||||
"eslint": "7.30.0",
|
||||
"eslint": "7.32.0",
|
||||
"eslint-config-prettier": "8.3.0",
|
||||
"jest": "26.6.3",
|
||||
"jest-extended": "0.11.5",
|
||||
"jest-fetch-mock": "3.0.3",
|
||||
"metro-react-native-babel-preset": "0.66.0",
|
||||
"prettier": "2.3.2",
|
||||
"react-native-clean-project": "3.6.4",
|
||||
"prettier": "2.4.0",
|
||||
"react-native-clean-project": "3.6.7",
|
||||
"react-native-codegen": "0.0.7",
|
||||
"react-native-version": "4.0.0",
|
||||
"react-test-renderer": "17.0.2",
|
||||
"typescript": "4.3.5"
|
||||
"typescript": "4.4.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
|
|
|
@ -27,7 +27,7 @@ import { useCollapsible } from '../../context/CollapsibleContext';
|
|||
export const TAB_BAR_HEIGHT = 50;
|
||||
|
||||
function CustomTabBar(
|
||||
props: BottomTabBarProps<any> & {
|
||||
props: BottomTabBarProps & {
|
||||
icons: {
|
||||
[key: string]: {
|
||||
normal: string;
|
||||
|
@ -94,10 +94,7 @@ const styles = StyleSheet.create({
|
|||
},
|
||||
});
|
||||
|
||||
function areEqual(
|
||||
prevProps: BottomTabBarProps<any>,
|
||||
nextProps: BottomTabBarProps<any>
|
||||
) {
|
||||
function areEqual(prevProps: BottomTabBarProps, nextProps: BottomTabBarProps) {
|
||||
return prevProps.state.index === nextProps.state.index;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,13 @@ import {
|
|||
} from '../utils/asyncStorage';
|
||||
import IntroScreen from '../screens/Intro/IntroScreen';
|
||||
import { useLoginState } from '../context/loginContext';
|
||||
import ProxiwashAboutScreen from '../screens/Proxiwash/ProxiwashAboutScreen';
|
||||
import PlanningDisplayScreen from '../screens/Planning/PlanningDisplayScreen';
|
||||
import ScannerScreen from '../screens/Home/ScannerScreen';
|
||||
import FeedItemScreen from '../screens/Home/FeedItemScreen';
|
||||
import GroupSelectionScreen from '../screens/Planex/GroupSelectionScreen';
|
||||
import ServicesSectionScreen from '../screens/Services/ServicesSectionScreen';
|
||||
import AmicaleContactScreen from '../screens/Amicale/AmicaleContactScreen';
|
||||
|
||||
export enum MainRoutes {
|
||||
Main = 'main',
|
||||
|
@ -304,6 +311,45 @@ function getRegularScreens(createTabNavigator: () => React.ReactElement) {
|
|||
title: i18n.t('screens.feedback.title'),
|
||||
}}
|
||||
/>
|
||||
<MainStack.Screen
|
||||
name={'proxiwash-about'}
|
||||
component={ProxiwashAboutScreen}
|
||||
options={{ title: i18n.t('screens.proxiwash.title') }}
|
||||
/>
|
||||
<MainStack.Screen
|
||||
name={'planning-information'}
|
||||
component={PlanningDisplayScreen}
|
||||
options={{ title: i18n.t('screens.planning.eventDetails') }}
|
||||
/>
|
||||
<MainStack.Screen
|
||||
name={'scanner'}
|
||||
component={ScannerScreen}
|
||||
options={{ title: i18n.t('screens.scanner.title') }}
|
||||
/>
|
||||
<MainStack.Screen
|
||||
name={'feed-information'}
|
||||
component={FeedItemScreen}
|
||||
options={{
|
||||
title: i18n.t('screens.home.feed'),
|
||||
}}
|
||||
/>
|
||||
<MainStack.Screen
|
||||
name={'group-select'}
|
||||
component={GroupSelectionScreen}
|
||||
options={{
|
||||
title: '',
|
||||
}}
|
||||
/>
|
||||
<MainStack.Screen
|
||||
name={'services-section'}
|
||||
component={ServicesSectionScreen}
|
||||
options={{ title: 'SECTION' }}
|
||||
/>
|
||||
<MainStack.Screen
|
||||
name={'amicale-contact'}
|
||||
component={AmicaleContactScreen}
|
||||
options={{ title: i18n.t('screens.amicaleAbout.title') }}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
@ -317,7 +363,7 @@ function MainStackComponent(props: {
|
|||
return (
|
||||
<MainStack.Navigator
|
||||
initialRouteName={showIntro ? MainRoutes.Intro : MainRoutes.Main}
|
||||
headerMode={'screen'}
|
||||
headerMode={'float'}
|
||||
>
|
||||
{showIntro ? getIntroScreens() : getRegularScreens(createTabNavigator)}
|
||||
{isloggedIn ? getAmicaleScreens() : null}
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
|
||||
import * as React from 'react';
|
||||
import { createStackNavigator } from '@react-navigation/stack';
|
||||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
||||
|
||||
import { Title, useTheme } from 'react-native-paper';
|
||||
|
@ -27,18 +26,10 @@ import i18n from 'i18n-js';
|
|||
import { View } from 'react-native-animatable';
|
||||
import HomeScreen from '../screens/Home/HomeScreen';
|
||||
import PlanningScreen from '../screens/Planning/PlanningScreen';
|
||||
import PlanningDisplayScreen from '../screens/Planning/PlanningDisplayScreen';
|
||||
import ProxiwashScreen from '../screens/Proxiwash/ProxiwashScreen';
|
||||
import ProxiwashAboutScreen from '../screens/Proxiwash/ProxiwashAboutScreen';
|
||||
import PlanexScreen from '../screens/Planex/PlanexScreen';
|
||||
import ClubDisplayScreen from '../screens/Amicale/Clubs/ClubDisplayScreen';
|
||||
import ScannerScreen from '../screens/Home/ScannerScreen';
|
||||
import FeedItemScreen from '../screens/Home/FeedItemScreen';
|
||||
import GroupSelectionScreen from '../screens/Planex/GroupSelectionScreen';
|
||||
import CustomTabBar from '../components/Tabbar/CustomTabBar';
|
||||
import WebsitesHomeScreen from '../screens/Services/ServicesScreen';
|
||||
import ServicesSectionScreen from '../screens/Services/ServicesSectionScreen';
|
||||
import AmicaleContactScreen from '../screens/Amicale/AmicaleContactScreen';
|
||||
import Mascot, { MASCOT_STYLE } from '../components/Mascot/Mascot';
|
||||
import { usePreferences } from '../context/preferencesContext';
|
||||
import {
|
||||
|
@ -74,170 +65,6 @@ export type FullParamsList = DefaultParams & {
|
|||
export type TabStackParamsList = FullParamsList &
|
||||
Record<string, object | undefined>;
|
||||
|
||||
const ServicesStack = createStackNavigator();
|
||||
|
||||
function ServicesStackComponent() {
|
||||
return (
|
||||
<ServicesStack.Navigator
|
||||
initialRouteName={'services'}
|
||||
headerMode={'screen'}
|
||||
>
|
||||
<ServicesStack.Screen
|
||||
name={'services'}
|
||||
component={WebsitesHomeScreen}
|
||||
options={{ title: i18n.t('screens.services.title') }}
|
||||
/>
|
||||
<ServicesStack.Screen
|
||||
name={'services-section'}
|
||||
component={ServicesSectionScreen}
|
||||
options={{ title: 'SECTION' }}
|
||||
/>
|
||||
<ServicesStack.Screen
|
||||
name={'amicale-contact'}
|
||||
component={AmicaleContactScreen}
|
||||
options={{ title: i18n.t('screens.amicaleAbout.title') }}
|
||||
/>
|
||||
</ServicesStack.Navigator>
|
||||
);
|
||||
}
|
||||
|
||||
const ProxiwashStack = createStackNavigator();
|
||||
|
||||
function ProxiwashStackComponent() {
|
||||
return (
|
||||
<ProxiwashStack.Navigator
|
||||
initialRouteName={'proxiwash'}
|
||||
headerMode={'screen'}
|
||||
>
|
||||
<ProxiwashStack.Screen
|
||||
name={'proxiwash'}
|
||||
component={ProxiwashScreen}
|
||||
options={{ title: i18n.t('screens.proxiwash.title') }}
|
||||
/>
|
||||
<ProxiwashStack.Screen
|
||||
name={'proxiwash-about'}
|
||||
component={ProxiwashAboutScreen}
|
||||
options={{ title: i18n.t('screens.proxiwash.title') }}
|
||||
/>
|
||||
</ProxiwashStack.Navigator>
|
||||
);
|
||||
}
|
||||
|
||||
const PlanningStack = createStackNavigator();
|
||||
|
||||
function PlanningStackComponent() {
|
||||
return (
|
||||
<PlanningStack.Navigator initialRouteName={'events'} headerMode={'screen'}>
|
||||
<PlanningStack.Screen
|
||||
name={'events'}
|
||||
component={PlanningScreen}
|
||||
options={{ title: i18n.t('screens.planning.title') }}
|
||||
/>
|
||||
<PlanningStack.Screen
|
||||
name={'planning-information'}
|
||||
component={PlanningDisplayScreen}
|
||||
options={{ title: i18n.t('screens.planning.eventDetails') }}
|
||||
/>
|
||||
</PlanningStack.Navigator>
|
||||
);
|
||||
}
|
||||
|
||||
const HomeStack = createStackNavigator();
|
||||
|
||||
function HomeStackComponent(
|
||||
initialRoute?: string,
|
||||
defaultData?: { [key: string]: string }
|
||||
) {
|
||||
let params;
|
||||
if (initialRoute) {
|
||||
params = { data: defaultData, nextScreen: initialRoute, shouldOpen: true };
|
||||
}
|
||||
const { colors } = useTheme();
|
||||
return (
|
||||
<HomeStack.Navigator initialRouteName={'home'} headerMode={'screen'}>
|
||||
<HomeStack.Screen
|
||||
name={'home'}
|
||||
component={HomeScreen}
|
||||
options={{
|
||||
title: i18n.t('screens.home.title'),
|
||||
headerStyle: {
|
||||
backgroundColor: colors.surface,
|
||||
},
|
||||
headerTitle: (headerProps) => (
|
||||
<View style={styles.header}>
|
||||
<Mascot
|
||||
style={styles.mascot}
|
||||
emotion={MASCOT_STYLE.RANDOM}
|
||||
animated
|
||||
entryAnimation={{
|
||||
animation: 'bounceIn',
|
||||
duration: 1000,
|
||||
}}
|
||||
loopAnimation={{
|
||||
animation: 'pulse',
|
||||
duration: 2000,
|
||||
iterationCount: 'infinite',
|
||||
}}
|
||||
/>
|
||||
<Title style={styles.title}>{headerProps.children}</Title>
|
||||
</View>
|
||||
),
|
||||
}}
|
||||
initialParams={params}
|
||||
/>
|
||||
<HomeStack.Screen
|
||||
name={'scanner'}
|
||||
component={ScannerScreen}
|
||||
options={{ title: i18n.t('screens.scanner.title') }}
|
||||
/>
|
||||
<HomeStack.Screen
|
||||
name={'club-information'}
|
||||
component={ClubDisplayScreen}
|
||||
options={{
|
||||
title: i18n.t('screens.clubs.details'),
|
||||
}}
|
||||
/>
|
||||
<HomeStack.Screen
|
||||
name={'feed-information'}
|
||||
component={FeedItemScreen}
|
||||
options={{
|
||||
title: i18n.t('screens.home.feed'),
|
||||
}}
|
||||
/>
|
||||
<HomeStack.Screen
|
||||
name={'planning-information'}
|
||||
component={PlanningDisplayScreen}
|
||||
options={{
|
||||
title: i18n.t('screens.planning.eventDetails'),
|
||||
}}
|
||||
/>
|
||||
</HomeStack.Navigator>
|
||||
);
|
||||
}
|
||||
|
||||
const PlanexStack = createStackNavigator();
|
||||
|
||||
function PlanexStackComponent() {
|
||||
return (
|
||||
<PlanexStack.Navigator initialRouteName={'planex'} headerMode={'screen'}>
|
||||
<PlanexStack.Screen
|
||||
name={'planex'}
|
||||
component={PlanexScreen}
|
||||
options={{
|
||||
title: i18n.t('screens.planex.title'),
|
||||
}}
|
||||
/>
|
||||
<PlanexStack.Screen
|
||||
name={'group-select'}
|
||||
component={GroupSelectionScreen}
|
||||
options={{
|
||||
title: '',
|
||||
}}
|
||||
/>
|
||||
</PlanexStack.Navigator>
|
||||
);
|
||||
}
|
||||
|
||||
const Tab = createBottomTabNavigator<TabStackParamsList>();
|
||||
|
||||
type PropsType = {
|
||||
|
@ -285,8 +112,15 @@ function TabNavigator(props: PropsType) {
|
|||
defaultRoute = defaultRoute.toLowerCase();
|
||||
}
|
||||
|
||||
const createHomeStackComponent = () =>
|
||||
HomeStackComponent(props.defaultHomeRoute, props.defaultHomeData);
|
||||
let params;
|
||||
if (props.defaultHomeRoute) {
|
||||
params = {
|
||||
data: props.defaultHomeData,
|
||||
nextScreen: props.defaultHomeRoute,
|
||||
shouldOpen: true,
|
||||
};
|
||||
}
|
||||
const { colors } = useTheme();
|
||||
|
||||
const LABELS: {
|
||||
[key: string]: string;
|
||||
|
@ -306,28 +140,55 @@ function TabNavigator(props: PropsType) {
|
|||
>
|
||||
<Tab.Screen
|
||||
name={'services'}
|
||||
component={ServicesStackComponent}
|
||||
component={WebsitesHomeScreen}
|
||||
options={{ title: i18n.t('screens.services.title') }}
|
||||
/>
|
||||
<Tab.Screen
|
||||
name={'proxiwash'}
|
||||
component={ProxiwashStackComponent}
|
||||
component={ProxiwashScreen}
|
||||
options={{ title: i18n.t('screens.proxiwash.title') }}
|
||||
/>
|
||||
<Tab.Screen
|
||||
name={'home'}
|
||||
component={createHomeStackComponent}
|
||||
options={{ title: i18n.t('screens.home.title') }}
|
||||
component={HomeScreen}
|
||||
options={{
|
||||
title: i18n.t('screens.home.title'),
|
||||
headerStyle: {
|
||||
backgroundColor: colors.surface,
|
||||
},
|
||||
headerTitle: (headerProps) => (
|
||||
<View style={styles.header}>
|
||||
<Mascot
|
||||
style={styles.mascot}
|
||||
emotion={MASCOT_STYLE.RANDOM}
|
||||
animated
|
||||
entryAnimation={{
|
||||
animation: 'bounceIn',
|
||||
duration: 1000,
|
||||
}}
|
||||
loopAnimation={{
|
||||
animation: 'pulse',
|
||||
duration: 2000,
|
||||
iterationCount: 'infinite',
|
||||
}}
|
||||
/>
|
||||
<Title style={styles.title}>{headerProps.children}</Title>
|
||||
</View>
|
||||
),
|
||||
}}
|
||||
initialParams={params}
|
||||
/>
|
||||
<Tab.Screen
|
||||
name={'events'}
|
||||
component={PlanningStackComponent}
|
||||
component={PlanningScreen}
|
||||
options={{ title: i18n.t('screens.planning.title') }}
|
||||
/>
|
||||
<Tab.Screen
|
||||
name={'planex'}
|
||||
component={PlanexStackComponent}
|
||||
options={{ title: i18n.t('screens.planex.title') }}
|
||||
component={PlanexScreen}
|
||||
options={{
|
||||
title: i18n.t('screens.planex.title'),
|
||||
}}
|
||||
/>
|
||||
</Tab.Navigator>
|
||||
);
|
||||
|
|
|
@ -26,7 +26,6 @@ import i18n from 'i18n-js';
|
|||
import { PERMISSIONS, request, RESULTS } from 'react-native-permissions';
|
||||
import URLHandler from '../../utils/URLHandler';
|
||||
import AlertDialog from '../../components/Dialogs/AlertDialog';
|
||||
import { TAB_BAR_HEIGHT } from '../../components/Tabbar/CustomTabBar';
|
||||
import LoadingConfirmDialog from '../../components/Dialogs/LoadingConfirmDialog';
|
||||
import { MASCOT_STYLE } from '../../components/Mascot/Mascot';
|
||||
import MascotPopup from '../../components/Mascot/MascotPopup';
|
||||
|
@ -223,7 +222,6 @@ class ScannerScreen extends React.Component<{}, StateType> {
|
|||
<View
|
||||
style={{
|
||||
...styles.container,
|
||||
marginBottom: TAB_BAR_HEIGHT,
|
||||
}}
|
||||
>
|
||||
{state.hasPermission ? this.getScanner() : this.getPermissionScreen()}
|
||||
|
|
|
@ -87,7 +87,7 @@ function GroupSelectionScreen() {
|
|||
headerTitleContainerStyle:
|
||||
Platform.OS === 'ios'
|
||||
? { marginHorizontal: 0, width: '70%' }
|
||||
: { marginHorizontal: 0, right: 50, left: 50 },
|
||||
: { width: '100%' },
|
||||
});
|
||||
}, [navigation]);
|
||||
|
||||
|
|
|
@ -177,8 +177,8 @@ export function setupMachineNotification(
|
|||
if (isEnabled && endDate) {
|
||||
createNotifications(machineID, endDate, reminder);
|
||||
} else {
|
||||
PushNotification.cancelLocalNotifications({ id: machineID });
|
||||
PushNotification.cancelLocalNotification(machineID);
|
||||
const reminderId = reminderIdFactor * parseInt(machineID, 10);
|
||||
PushNotification.cancelLocalNotifications({ id: reminderId.toString() });
|
||||
PushNotification.cancelLocalNotification(reminderId.toString());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue