Skip to content

Commit

Permalink
refractor(changelog): réorganisation du code
Browse files Browse the repository at this point in the history
  • Loading branch information
Kgeek33 committed Feb 9, 2025
1 parent db7274e commit 01a4913
Showing 1 changed file with 107 additions and 113 deletions.
220 changes: 107 additions & 113 deletions src/views/welcome/ChangelogScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,23 @@ const ChangelogScreen: Screen<"ChangelogScreen"> = ({ route, navigation }) => {
]}
contentInsetAdjustmentBehavior="automatic"
>
{loading && (
{!isOnline ? (
<OfflineWarning cache={false} />
) : loading ? (
<NativeList
inline
animated
entering={animPapillon(FadeInUp)}
exiting={animPapillon(FadeOutUp)}
>
<NativeItem
leading={<PapillonSpinner color={theme.colors.primary} size={24} strokeWidth={3.5} />}
leading={
<PapillonSpinner
color={theme.colors.primary}
size={24}
strokeWidth={3.5}
/>
}
>
<NativeText variant="title">
Chargement des nouveautés...
Expand All @@ -129,20 +137,14 @@ const ChangelogScreen: Screen<"ChangelogScreen"> = ({ route, navigation }) => {
</NativeText>
</NativeItem>
</NativeList>
)}

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

{notFound && (
) : notFound ? (
<NativeList
inline
animated
entering={animPapillon(FadeInUp)}
exiting={animPapillon(FadeOutUp)}
>
<NativeItem
icon={<AlertTriangle />}
>
<NativeItem icon={<AlertTriangle />}>
<NativeText variant="title">
Impossible de trouver les notes de mise à jour
</NativeText>
Expand All @@ -152,116 +154,108 @@ const ChangelogScreen: Screen<"ChangelogScreen"> = ({ route, navigation }) => {
</NativeText>
</NativeItem>
</NativeList>
)}

{changelog && (
<Reanimated.View
entering={animPapillon(FadeInUp)}
exiting={animPapillon(FadeOutUp)}
layout={animPapillon(LinearTransition)}
>
<PressableScale>
<NativeList
animated inline
>
<Image
source={{uri: changelog.illustration}}
style={{
width: "100%",
aspectRatio: 2 / 1
}}
/>
<NativeItem pointerEvents="none">
<NativeText
variant="default"
) : (
changelog && (
<Reanimated.View
entering={animPapillon(FadeInUp)}
exiting={animPapillon(FadeOutUp)}
layout={animPapillon(LinearTransition)}
>
<PressableScale>
<NativeList animated inline>
<Image
source={{ uri: changelog.illustration }}
style={{
color: theme.colors.primary,
fontFamily: "semibold"
width: "100%",
aspectRatio: 2 / 1,
}}
>
Papillon - version {changelog.version}
</NativeText>
<NativeText
variant="titleLarge"
>
{changelog.title}
</NativeText>
<NativeText variant="subtitle">
{changelog.subtitle}
</NativeText>
</NativeItem>
<NativeItem pointerEvents="none">
<NativeText variant="default">
{changelog.description}
</NativeText>
</NativeItem>
</NativeList>
</PressableScale>
/>
<NativeItem pointerEvents="none">
<NativeText
variant="default"
style={{
color: theme.colors.primary,
fontFamily: "semibold",
}}
>
Papillon - version {changelog.version}
</NativeText>
<NativeText variant="titleLarge">
{changelog.title}
</NativeText>
<NativeText variant="subtitle">
{changelog.subtitle}
</NativeText>
</NativeItem>
<NativeItem pointerEvents="none">
<NativeText variant="default">
{changelog.description}
</NativeText>
</NativeItem>
</NativeList>
</PressableScale>

<Reanimated.View>
<NativeListHeader
animated
label="Nouveautés"
icon={<Sparkles />}
/>
<Reanimated.View>
<NativeListHeader
animated
label="Nouveautés"
icon={<Sparkles />}
/>

<Reanimated.ScrollView
horizontal
style={{
width: "100%",
overflow: "visible",
marginTop: 9
}}
contentContainerStyle={{
gap: 10
}}
showsHorizontalScrollIndicator={false}
>
{changelog.features.map((feature: Feature, index) => {
return (
<ChangelogFeature
key={index}
feature={feature}
navigation={navigation}
theme={theme}
/>
);
})}
</Reanimated.ScrollView>
</Reanimated.View>
<Reanimated.ScrollView
horizontal
style={{
width: "100%",
overflow: "visible",
marginTop: 9,
}}
contentContainerStyle={{
gap: 10,
}}
showsHorizontalScrollIndicator={false}
>
{changelog.features.map((feature: Feature, index) => {
return (
<ChangelogFeature
key={index}
feature={feature}
navigation={navigation}
theme={theme}
/>
);
})}
</Reanimated.ScrollView>
</Reanimated.View>

<Reanimated.View>
<NativeListHeader
animated
label="Correctifs"
icon={<Bug />}
/>
<Reanimated.View>
<NativeListHeader animated label="Correctifs" icon={<Bug />} />

<Reanimated.ScrollView
horizontal
style={{
width: "100%",
overflow: "visible",
marginTop: 9
}}
contentContainerStyle={{
gap: 10
}}
showsHorizontalScrollIndicator={false}
>
{changelog.bugfixes.map((feature: Feature, index) => {
return (
<ChangelogFeature
key={index}
feature={feature}
navigation={navigation}
theme={theme}
/>
);
})}
</Reanimated.ScrollView>
<Reanimated.ScrollView
horizontal
style={{
width: "100%",
overflow: "visible",
marginTop: 9,
}}
contentContainerStyle={{
gap: 10,
}}
showsHorizontalScrollIndicator={false}
>
{changelog.bugfixes.map((feature: Feature, index) => {
return (
<ChangelogFeature
key={index}
feature={feature}
navigation={navigation}
theme={theme}
/>
);
})}
</Reanimated.ScrollView>
</Reanimated.View>
</Reanimated.View>
</Reanimated.View>
)
)}

<InsetsBottomView />
Expand Down

0 comments on commit 01a4913

Please sign in to comment.