-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new match * tests ok * fix app
- Loading branch information
Showing
75 changed files
with
1,201 additions
and
1,911 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Detached, ResolvedLianeRequest } from "@liane/common"; | ||
import { AppText } from "@/components/base/AppText.tsx"; | ||
import { AppColors } from "@/theme/colors.ts"; | ||
import { Pressable, StyleSheet, View } from "react-native"; | ||
import { Row } from "@/components/base/AppLayout.tsx"; | ||
import { AppIcon } from "@/components/base/AppIcon.tsx"; | ||
import React from "react"; | ||
import { useAppNavigation } from "@/components/context/routing.ts"; | ||
|
||
export type DetachedLianeItemProps = { | ||
lianeRequest: ResolvedLianeRequest; | ||
state: Detached; | ||
}; | ||
|
||
export const DetachedLianeItem = ({ lianeRequest, state }: DetachedLianeItemProps) => { | ||
const { navigation } = useAppNavigation(); | ||
|
||
if (state.matches.length === 0) { | ||
return ( | ||
<AppText style={{ fontSize: 14, fontWeight: "bold", lineHeight: 23, color: AppColors.orange }}> | ||
Cette liane est en attente de conducteur | ||
</AppText> | ||
); | ||
} | ||
|
||
return ( | ||
<Pressable | ||
style={{ flexDirection: "row", justifyContent: "space-between", alignItems: "center", flex: 1, paddingVertical: 5 }} | ||
onPress={() => navigation.navigate("ListGroups", { groups: state.matches, lianeRequest })}> | ||
<Row> | ||
<View style={styles.notificationDotContainer}> | ||
<View style={styles.notificationDot} /> | ||
</View> | ||
<AppText | ||
style={{ | ||
fontSize: 14, | ||
fontWeight: "bold", | ||
lineHeight: 23, | ||
color: AppColors.orange, | ||
marginLeft: 5 | ||
}}> | ||
{state.matches.length === 1 ? "Voir la liane disponible" : `Voir les ${state.matches.length} lianes disponibles`} | ||
</AppText> | ||
</Row> | ||
<AppIcon name={"arrow-right"} /> | ||
</Pressable> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
notificationDotContainer: { | ||
justifyContent: "center", | ||
alignItems: "center" | ||
}, | ||
notificationDot: { | ||
width: 8, | ||
height: 8, | ||
borderRadius: 6, | ||
backgroundColor: AppColors.orange | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.