chore: update notification interface deliveryman

This commit is contained in:
2026-03-21 12:07:59 +01:00
parent ee53ee8454
commit a8eeb55e72
2 changed files with 35 additions and 51 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ export const resetClientPenalties = async (clientUsername: string) => {
return { success: true, message: data.message }; return { success: true, message: data.message };
}; };
// pool: 0 = pool principal (point), 1 = pool secondaire (point_zipette), -1 = tous // pool: index dans pool_names/pool_keys, -1 = reset tous les points
export const resetClientPoints = async ( export const resetClientPoints = async (
clientUsername: string, clientUsername: string,
pool: number = -1, pool: number = -1,
@@ -17,7 +17,7 @@ import {
markLivreurNotificationsRead, markLivreurNotificationsRead,
} from "../api/api_delivery"; } from "../api/api_delivery";
import type { LivreurNotification } from "../api/api_delivery"; import type { LivreurNotification } from "../api/api_delivery";
import { fontSize, spacing, borderRadius } from "../theme"; import { fontSize, spacing } from "../theme";
import type { DeliveryTabParamList } from "./types"; import type { DeliveryTabParamList } from "./types";
import DashboardScreen from "../screens/delivery/DashboardScreen"; import DashboardScreen from "../screens/delivery/DashboardScreen";
@@ -214,31 +214,15 @@ export default function DeliveryNavigator() {
<View <View
style={[ style={[
styles.modalContent, styles.modalContent,
{ backgroundColor: colors.bgPrimary }, { backgroundColor: colors.bgSecondary },
]} ]}
> >
{/* Header modal */} <View style={styles.modalHeader}>
<View <Text
style={[ style={[styles.modalTitle, { color: colors.textWhite }]}
styles.modalHeader, >
{ borderBottomColor: colors.border }, Notifications
]} </Text>
>
<View style={styles.modalTitleRow}>
<Ionicons
name="notifications-outline"
size={20}
color={colors.success}
/>
<Text
style={[
styles.modalTitle,
{ color: colors.textPrimary },
]}
>
Notifications
</Text>
</View>
<TouchableOpacity onPress={() => setShowModal(false)}> <TouchableOpacity onPress={() => setShowModal(false)}>
<Ionicons <Ionicons
name="close" name="close"
@@ -247,9 +231,7 @@ export default function DeliveryNavigator() {
/> />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<ScrollView style={styles.notifList}>
{/* Liste */}
<ScrollView style={{ flex: 1 }}>
{notifications.length === 0 ? ( {notifications.length === 0 ? (
<Text <Text
style={[ style={[
@@ -262,24 +244,23 @@ export default function DeliveryNavigator() {
) : ( ) : (
notifications.map((n, i) => ( notifications.map((n, i) => (
<View <View
key={`${n.command_id}-${n.type}-${n.created_at}-${i}`} key={i}
style={[ style={[
styles.notifItem, styles.notifItem,
{ {
borderBottomColor: colors.border,
borderLeftColor: n.read borderLeftColor: n.read
? "transparent" ? colors.border
: colors.success, : colors.success,
backgroundColor: n.read backgroundColor: n.read
? "transparent" ? "transparent"
: colors.success + "10", : colors.bgPrimary ?? colors.bgSecondary,
}, },
]} ]}
> >
<Text <Text
style={[ style={[
styles.notifMessage, styles.notifMessage,
{ color: colors.textPrimary }, { color: colors.textWhite },
]} ]}
> >
{n.message} {n.message}
@@ -322,45 +303,48 @@ const styles = StyleSheet.create({
}, },
overlay: { overlay: {
flex: 1, flex: 1,
justifyContent: "flex-end",
backgroundColor: "rgba(0,0,0,0.5)", backgroundColor: "rgba(0,0,0,0.5)",
justifyContent: "flex-end",
}, },
modalContent: { modalContent: {
height: "70%", borderTopLeftRadius: 16,
borderTopLeftRadius: borderRadius.lg, borderTopRightRadius: 16,
borderTopRightRadius: borderRadius.lg, maxHeight: "70%",
paddingBottom: 32,
}, },
modalHeader: { modalHeader: {
flexDirection: "row", flexDirection: "row",
justifyContent: "space-between", justifyContent: "space-between",
alignItems: "center", alignItems: "center",
padding: spacing.l, padding: 16,
borderBottomWidth: 1, borderBottomWidth: 1,
}, borderBottomColor: "rgba(255,255,255,0.1)",
modalTitleRow: {
flexDirection: "row",
alignItems: "center",
gap: spacing.s,
}, },
modalTitle: { modalTitle: {
fontSize: fontSize.lg, fontSize: 18,
fontWeight: "bold", fontWeight: "bold",
}, },
notifList: {
padding: 12,
},
emptyText: { emptyText: {
textAlign: "center", textAlign: "center",
marginTop: spacing.xl, marginTop: 32,
fontSize: fontSize.sm, fontSize: 14,
}, },
notifItem: { notifItem: {
padding: spacing.m,
borderBottomWidth: 1,
borderLeftWidth: 3, borderLeftWidth: 3,
paddingLeft: 12,
paddingVertical: 10,
marginBottom: 8,
borderRadius: 4,
paddingRight: 8,
}, },
notifMessage: { notifMessage: {
fontSize: fontSize.sm, fontSize: 14,
marginBottom: spacing.xs,
}, },
notifTime: { notifTime: {
fontSize: fontSize.xs, fontSize: 12,
marginTop: 4,
}, },
}); });