Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changements mineurs #34

Merged
merged 4 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions src/views/login/ServiceSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { memo, useEffect, useState } from "react";
import { Image, View, StyleSheet, StatusBar } from "react-native";
import { Image, View, StyleSheet, Text } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import Reanimated, { LinearTransition, FlipInXDown } from "react-native-reanimated";

Expand All @@ -15,6 +15,8 @@ import { useTheme } from "@react-navigation/native";
import GetV6Data from "@/utils/login/GetV6Data";

const ServiceSelector: Screen<"ServiceSelector"> = ({ navigation }) => {
const theme = useTheme();
const { colors } = theme;
const [sound, setSound] = useState<Audio.Sound | null>(null);

const { showAlert } = useAlert();
Expand All @@ -28,7 +30,7 @@ const ServiceSelector: Screen<"ServiceSelector"> = ({ navigation }) => {
setTimeout(async () => {
const v6Data = await GetV6Data();
setV6Data(v6Data);
if(v6Data.restore && !v6Data.imported) {
if (v6Data.restore && !v6Data.imported) {
navigation.navigate("PronoteV6Import", { data: v6Data.data });
}
}, 1);
Expand All @@ -45,13 +47,17 @@ const ServiceSelector: Screen<"ServiceSelector"> = ({ navigation }) => {
playSound();
break;
default:
showAlert({
title: "Service non supporté",
message: "Désolé, ce service n'est pas encore supporté. Veuillez réessayer dans une prochaine version."
});
UnsupportedAlert();
}
};

const UnsupportedAlert = () => {
showAlert({
title: "Service non supporté",
message: "Désolé, ce service n'est pas encore supporté. Veuillez réessayer dans une prochaine version."
});
};

useEffect(() => {
const loadSound = async () => {
const { sound } = await Audio.Sound.createAsync(
Expand Down Expand Up @@ -140,7 +146,7 @@ const ServiceSelector: Screen<"ServiceSelector"> = ({ navigation }) => {
}
text="Skolengo"
enabled={service === "skolengo"}
onPress={() => setService("skolengo")}
onPress={() => UnsupportedAlert()}
/>
</Reanimated.View>
</Reanimated.View>
Expand Down
3 changes: 2 additions & 1 deletion src/views/welcome/FirstInstallation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ const FirstInstallation: Screen<"FirstInstallation"> = ({ navigation }) => {
<View
style={styles.presentation}
>

<Image
source={require("../../../assets/images/mask_logotype.png")}
style={styles.logotype}
tintColor={colors.primary}
resizeMode="contain"
/>

<Text
style={[styles.presentation_text, { color: colors.text + "79" }]}
>
Expand All @@ -88,6 +88,7 @@ const FirstInstallation: Screen<"FirstInstallation"> = ({ navigation }) => {

<ButtonCta
value="Besoin d'aide ?"
onPress={() => openUrl("https://github.com/PapillonApp/Papillon/issues")}
/>
</View>

Expand Down