Skip to content

Commit cf52a89

Browse files
committed
Merge remote-tracking branch 'origin/fix/linter' into fix/linter
# Conflicts: # src/views/settings/SettingsAbout.tsx
2 parents ef2c9d1 + 0f7a14f commit cf52a89

File tree

6 files changed

+142
-29
lines changed

6 files changed

+142
-29
lines changed

src/components/Templates/LoginView.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ const LoginView: React.FC<{
4141
customFields: Record<string, string>
4242
) => unknown;
4343
customFields?: LoginViewCustomInput[];
44+
usernameLabel?: string;
45+
usernamePlaceholder?: string;
46+
passwordLabel?: string;
47+
passwordPlaceholder?: string;
4448
}> = ({
4549
serviceIcon,
4650
serviceName,
@@ -49,6 +53,10 @@ const LoginView: React.FC<{
4953
autoCapitalize = "none",
5054
onLogin,
5155
customFields = [],
56+
usernameLabel = "Identifiant",
57+
usernamePlaceholder = "Nom d'utilisateur",
58+
passwordLabel = "Mot de passe",
59+
passwordPlaceholder = "Mot de passe",
5260
}) => {
5361
const theme = useTheme();
5462
const insets = useSafeAreaInsets();
@@ -156,13 +164,13 @@ const LoginView: React.FC<{
156164
</NativeList>
157165
)}
158166

159-
<NativeListHeader label="Identifiant" />
167+
<NativeListHeader label={usernameLabel} />
160168
<NativeList>
161169
<NativeItem>
162170
<TextInput
163171
value={username}
164172
onChangeText={setUsername}
165-
placeholder="Nom d'utilisateur"
173+
placeholder={usernamePlaceholder}
166174
autoCapitalize={autoCapitalize}
167175
placeholderTextColor={theme.colors.text + "55"}
168176
style={{
@@ -175,7 +183,7 @@ const LoginView: React.FC<{
175183
</NativeItem>
176184
</NativeList>
177185

178-
<NativeListHeader label="Mot de passe" />
186+
<NativeListHeader label={passwordLabel} />
179187
<NativeList>
180188
<NativeItem>
181189
<View
@@ -188,7 +196,7 @@ const LoginView: React.FC<{
188196
<TextInput
189197
value={password}
190198
onChangeText={setPassword}
191-
placeholder="Mot de passe"
199+
placeholder={passwordPlaceholder}
192200
placeholderTextColor={theme.colors.text + "55"}
193201
autoCapitalize={autoCapitalize}
194202
style={{

src/router/helpers/PapillonTabNavigator.tsx

Lines changed: 107 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {
66
TabRouter,
77
useNavigationBuilder,
88
} from "@react-navigation/native";
9-
import { Text } from "react-native";
9+
import { Platform, Text } from "react-native";
1010

11-
import React, { useEffect, useRef } from "react";
11+
import React, { useEffect, useMemo, useRef, useState } from "react";
1212
import { View, Dimensions } from "react-native";
1313

1414
import { useSafeAreaInsets } from "react-native-safe-area-context";
@@ -22,10 +22,14 @@ import colorsList from "@/utils/data/colors.json";
2222

2323
import Reanimated, {
2424
useAnimatedStyle,
25-
useSharedValue,
2625
withTiming,
26+
withSpring,
27+
interpolate,
28+
useSharedValue,
29+
Easing,
2730
} from "react-native-reanimated";
2831
import * as Haptics from "expo-haptics";
32+
import getCorners from "@/utils/ui/corner-radius";
2933

3034
type DescriptorOptions = {
3135
tabBarLabel?: string;
@@ -432,41 +436,124 @@ const BottomTabNavigator: React.ComponentType<any> = ({
432436
}) => {
433437
const dims = Dimensions.get("window");
434438
const tablet = dims.width > 600;
439+
const mainNavigator = useRef(null);
440+
441+
// Track previous index to determine direction
442+
const [previousIndex, setPreviousIndex] = useState(0);
443+
444+
// Animation shared values
445+
const slideAnim = useSharedValue(0);
446+
const fadeAnim = useSharedValue(1);
447+
const [isAnimating, setIsAnimating] = useState(false);
448+
449+
const corners = useMemo(() => getCorners(), []);
450+
451+
const {
452+
state,
453+
descriptors,
454+
navigation,
455+
NavigationContent
456+
} = useNavigationBuilder(TabRouter, {
457+
initialRouteName,
458+
backBehavior,
459+
children,
460+
screenOptions,
461+
});
462+
463+
// Handle tab change animations
464+
useEffect(() => {
465+
if(Platform.OS !== "ios") return;
466+
if (state.index === previousIndex) return;
435467

436-
const { state, descriptors, navigation, NavigationContent } =
437-
useNavigationBuilder(TabRouter, {
438-
initialRouteName,
439-
backBehavior,
440-
children,
441-
screenOptions,
468+
// Determine animation direction
469+
const isMovingForward = state.index > previousIndex;
470+
setIsAnimating(true);
471+
472+
// Reset animations with direction
473+
fadeAnim.value = 0;
474+
slideAnim.value = isMovingForward ? 80 : -80;
475+
476+
fadeAnim.value = withTiming(1, {
477+
duration: 200,
478+
easing: Easing.inOut(Easing.ease),
479+
});
480+
slideAnim.value = withTiming(0, {
481+
duration: 400,
482+
easing: Easing.out(Easing.exp),
442483
});
443484

485+
// Update previous index
486+
setPreviousIndex(state.index);
487+
setTimeout(() => {
488+
setIsAnimating(false);
489+
}, 300);
490+
}, [state.index, dims.width]);
491+
492+
// Create animated styles
493+
const animatedStyles = useAnimatedStyle(() => {
494+
return {
495+
opacity: fadeAnim.value,
496+
transform: [
497+
{
498+
translateX: slideAnim.value,
499+
},
500+
],
501+
};
502+
});
503+
444504
return (
445505
<NavigationContent>
446506
<View
447507
style={[
448508
{
449509
flex: 1,
510+
overflow: "hidden", // Prevent content from showing outside bounds during animation
450511
},
451512
tablet && {
452513
flexDirection: "row-reverse",
453514
},
454515
]}
455516
>
456-
<BottomTabView
457-
{...rest}
458-
state = { state }
459-
navigation = { navigation }
460-
descriptors = { descriptors }
461-
/>
462-
{!tablet ?
463-
<BasePapillonBar state={state} descriptors={descriptors} navigation={navigation} />
464-
:
465-
<LargePapillonBar state={state} descriptors={descriptors} navigation={navigation} />
466-
}
517+
<Reanimated.View
518+
ref={mainNavigator}
519+
style={[
520+
{
521+
flex: 1,
522+
},
523+
Platform.OS === "ios" && isAnimating && {
524+
borderTopLeftRadius: corners,
525+
borderTopRightRadius: corners,
526+
borderCurve: "continuous",
527+
overflow: "hidden",
528+
},
529+
animatedStyles,
530+
]}
531+
>
532+
<BottomTabView
533+
{...rest}
534+
state={state}
535+
navigation={navigation}
536+
descriptors={descriptors}
537+
/>
538+
</Reanimated.View>
539+
540+
{!tablet ? (
541+
<BasePapillonBar
542+
state={state}
543+
descriptors={descriptors}
544+
navigation={navigation}
545+
/>
546+
) : (
547+
<LargePapillonBar
548+
state={state}
549+
descriptors={descriptors}
550+
navigation={navigation}
551+
/>
552+
)}
467553
</View>
468554
</NavigationContent>
469555
);
470556
};
471557

558+
472559
export default createNavigatorFactory(BottomTabNavigator);

src/views/account/Home/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ const Home: Screen<"HomeScreen"> = ({ navigation }) => {
222222
return (
223223
<View style={{flex: 1}}>
224224
{!modalOpen && focused && (
225-
<StatusBar barStyle="light-content" />
225+
<StatusBar barStyle="light-content" backgroundColor={"transparent"} translucent />
226226
)}
227227
<ContextMenu
228228
style={[{

src/views/settings/ExternalAccount/Izly.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ const ExternalIzlyLogin: Screen<"ExternalIzlyLogin"> = ({ navigation }) => {
3232
onLogin={(username, password) => handleLogin(username, password)}
3333
loading={loading}
3434
error={error}
35+
usernamePlaceholder="Identifiant ou adresse e-mail"
36+
passwordLabel="Code Izly"
37+
passwordPlaceholder="Code Izly à 6 chiffres"
3538
/>
3639
);
3740
};

src/views/settings/ExternalAccount/IzlyActivation.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const IzlyActivation: Screen<"IzlyActivation"> = ({ navigation, route }) => {
7878
style={styles.container}
7979
>
8080
<PapillonShineBubble
81-
message={"Un lien d'activation à était envoyé, peux-tu me le donner ?"}
81+
message={"Tu viens de recevoir un lien par SMS, peux tu me l'indiquer ?"}
8282
width={270}
8383
numberOfLines={2}
8484
offsetTop={insets.top}
@@ -125,6 +125,19 @@ const IzlyActivation: Screen<"IzlyActivation"> = ({ navigation, route }) => {
125125
</View>
126126
</View>
127127

128+
<NativeText
129+
pointerEvents="none"
130+
style={{
131+
width: "100%",
132+
paddingHorizontal: 16,
133+
fontSize: 14,
134+
color: colors.text + "55",
135+
textAlign: "center",
136+
}}
137+
>
138+
Papillon ne donnera jamais vos informations d'authentification à des tiers.
139+
</NativeText>
140+
128141

129142
<View style={styles.buttons}>
130143
<ButtonCta

src/views/settings/SettingsAbout.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,11 @@ const SettingsAbout: Screen<"SettingsAbout"> = ({ navigation }) => {
187187
<NativeText variant="title">
188188
Version des dépendances
189189
</NativeText>
190-
<NativeText variant="subtitle">
191-
RN : {PackageJSON.dependencies["react-native"].split("^")[1]} | Expo : {PackageJSON.devDependencies.expo.split("~")[1]}
192-
</NativeText>
190+
{PackageJSON.dependencies["react-native"] && PackageJSON.devDependencies.expo &&
191+
<NativeText variant="subtitle">
192+
RN : {PackageJSON.dependencies["react-native"].split("^")[1]} | Expo : {PackageJSON.devDependencies.expo.split("^")[1]}
193+
</NativeText>
194+
}
193195
</NativeItem>
194196
</NativeList>
195197

0 commit comments

Comments
 (0)