Skip to content

Commit

Permalink
feat(changelog): ajout d'un avertissement hors ligne et amélioration …
Browse files Browse the repository at this point in the history
…des messages d'erreur
  • Loading branch information
Kgeek33 committed Feb 9, 2025
1 parent ba5249b commit db7274e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/views/welcome/ChangelogScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { PressableScale } from "react-native-pressable-scale";

import AsyncStorage from "@react-native-async-storage/async-storage";
import {Screen} from "@/router/helpers/types";
import { OfflineWarning, useOnlineStatus } from "@/hooks/useOnlineStatus";

interface Feature {
title: string;
Expand All @@ -44,6 +45,7 @@ const changelogURL = datasets.changelog.replace("[version]", currentVersion);
const ChangelogScreen: Screen<"ChangelogScreen"> = ({ route, navigation }) => {
const theme = useTheme();
const insets = useSafeAreaInsets();
const { isOnline } = useOnlineStatus();

const [changelog, setChangelog] = useState<Version|null>(null);
const [loading, setLoading] = useState(true);
Expand Down Expand Up @@ -129,6 +131,8 @@ const ChangelogScreen: Screen<"ChangelogScreen"> = ({ route, navigation }) => {
</NativeList>
)}

{!isOnline && <OfflineWarning cache={false} />}

{notFound && (
<NativeList
inline
Expand All @@ -143,7 +147,8 @@ const ChangelogScreen: Screen<"ChangelogScreen"> = ({ route, navigation }) => {
Impossible de trouver les notes de mise à jour
</NativeText>
<NativeText variant="subtitle">
Tu es peut-être hors-ligne ou alors une erreur est survenue...
Les nouveautés de la version n'ont pas du être renseignées ou
alors une erreur est survenue...
</NativeText>
</NativeItem>
</NativeList>
Expand Down

0 comments on commit db7274e

Please sign in to comment.