chore: update notification interface deliveryman
This commit is contained in:
@@ -74,7 +74,7 @@ export const resetClientPenalties = async (clientUsername: string) => {
|
||||
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 (
|
||||
clientUsername: string,
|
||||
pool: number = -1,
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
markLivreurNotificationsRead,
|
||||
} 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 DashboardScreen from "../screens/delivery/DashboardScreen";
|
||||
@@ -214,31 +214,15 @@ export default function DeliveryNavigator() {
|
||||
<View
|
||||
style={[
|
||||
styles.modalContent,
|
||||
{ backgroundColor: colors.bgPrimary },
|
||||
{ backgroundColor: colors.bgSecondary },
|
||||
]}
|
||||
>
|
||||
{/* Header modal */}
|
||||
<View
|
||||
style={[
|
||||
styles.modalHeader,
|
||||
{ borderBottomColor: colors.border },
|
||||
]}
|
||||
>
|
||||
<View style={styles.modalTitleRow}>
|
||||
<Ionicons
|
||||
name="notifications-outline"
|
||||
size={20}
|
||||
color={colors.success}
|
||||
/>
|
||||
<Text
|
||||
style={[
|
||||
styles.modalTitle,
|
||||
{ color: colors.textPrimary },
|
||||
]}
|
||||
>
|
||||
Notifications
|
||||
</Text>
|
||||
</View>
|
||||
<View style={styles.modalHeader}>
|
||||
<Text
|
||||
style={[styles.modalTitle, { color: colors.textWhite }]}
|
||||
>
|
||||
Notifications
|
||||
</Text>
|
||||
<TouchableOpacity onPress={() => setShowModal(false)}>
|
||||
<Ionicons
|
||||
name="close"
|
||||
@@ -247,9 +231,7 @@ export default function DeliveryNavigator() {
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
{/* Liste */}
|
||||
<ScrollView style={{ flex: 1 }}>
|
||||
<ScrollView style={styles.notifList}>
|
||||
{notifications.length === 0 ? (
|
||||
<Text
|
||||
style={[
|
||||
@@ -262,24 +244,23 @@ export default function DeliveryNavigator() {
|
||||
) : (
|
||||
notifications.map((n, i) => (
|
||||
<View
|
||||
key={`${n.command_id}-${n.type}-${n.created_at}-${i}`}
|
||||
key={i}
|
||||
style={[
|
||||
styles.notifItem,
|
||||
{
|
||||
borderBottomColor: colors.border,
|
||||
borderLeftColor: n.read
|
||||
? "transparent"
|
||||
? colors.border
|
||||
: colors.success,
|
||||
backgroundColor: n.read
|
||||
? "transparent"
|
||||
: colors.success + "10",
|
||||
: colors.bgPrimary ?? colors.bgSecondary,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Text
|
||||
style={[
|
||||
styles.notifMessage,
|
||||
{ color: colors.textPrimary },
|
||||
{ color: colors.textWhite },
|
||||
]}
|
||||
>
|
||||
{n.message}
|
||||
@@ -322,45 +303,48 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
overlay: {
|
||||
flex: 1,
|
||||
justifyContent: "flex-end",
|
||||
backgroundColor: "rgba(0,0,0,0.5)",
|
||||
justifyContent: "flex-end",
|
||||
},
|
||||
modalContent: {
|
||||
height: "70%",
|
||||
borderTopLeftRadius: borderRadius.lg,
|
||||
borderTopRightRadius: borderRadius.lg,
|
||||
borderTopLeftRadius: 16,
|
||||
borderTopRightRadius: 16,
|
||||
maxHeight: "70%",
|
||||
paddingBottom: 32,
|
||||
},
|
||||
modalHeader: {
|
||||
flexDirection: "row",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
padding: spacing.l,
|
||||
padding: 16,
|
||||
borderBottomWidth: 1,
|
||||
},
|
||||
modalTitleRow: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
gap: spacing.s,
|
||||
borderBottomColor: "rgba(255,255,255,0.1)",
|
||||
},
|
||||
modalTitle: {
|
||||
fontSize: fontSize.lg,
|
||||
fontSize: 18,
|
||||
fontWeight: "bold",
|
||||
},
|
||||
notifList: {
|
||||
padding: 12,
|
||||
},
|
||||
emptyText: {
|
||||
textAlign: "center",
|
||||
marginTop: spacing.xl,
|
||||
fontSize: fontSize.sm,
|
||||
marginTop: 32,
|
||||
fontSize: 14,
|
||||
},
|
||||
notifItem: {
|
||||
padding: spacing.m,
|
||||
borderBottomWidth: 1,
|
||||
borderLeftWidth: 3,
|
||||
paddingLeft: 12,
|
||||
paddingVertical: 10,
|
||||
marginBottom: 8,
|
||||
borderRadius: 4,
|
||||
paddingRight: 8,
|
||||
},
|
||||
notifMessage: {
|
||||
fontSize: fontSize.sm,
|
||||
marginBottom: spacing.xs,
|
||||
fontSize: 14,
|
||||
},
|
||||
notifTime: {
|
||||
fontSize: fontSize.xs,
|
||||
fontSize: 12,
|
||||
marginTop: 4,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user