chore: add waf
This commit is contained in:
@@ -37,24 +37,12 @@ import { useAlert } from "../../hooks/useAlert";
|
||||
|
||||
type Nav = NativeStackNavigationProp<AdminStackParamList>;
|
||||
|
||||
const STATUS_FILTERS = [
|
||||
"all",
|
||||
"pending",
|
||||
"assigned",
|
||||
"en_route",
|
||||
"arrived",
|
||||
"livre",
|
||||
"approved",
|
||||
"cancelled",
|
||||
];
|
||||
|
||||
export default function OrdersScreen() {
|
||||
const { colors } = useTheme();
|
||||
const navigation = useNavigation<Nav>();
|
||||
const [commands, setCommands] = useState<CommandResponse[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [refreshing, setRefreshing] = useState(false);
|
||||
const [filter, setFilter] = useState("all");
|
||||
const { alert, showError, showSuccess, showConfirm, hideAlert } =
|
||||
useAlert();
|
||||
|
||||
@@ -87,14 +75,13 @@ export default function OrdersScreen() {
|
||||
|
||||
const loadData = useCallback(async () => {
|
||||
try {
|
||||
const status = filter === "all" ? undefined : filter;
|
||||
const result = await getAllCommands(status);
|
||||
const result = await getAllCommands(undefined);
|
||||
setCommands(result.commands);
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
setLoading(false);
|
||||
}, [filter]);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
loadData();
|
||||
@@ -250,11 +237,6 @@ export default function OrdersScreen() {
|
||||
() =>
|
||||
StyleSheet.create({
|
||||
container: { flex: 1, backgroundColor: colors.bgPrimary },
|
||||
filterList: {
|
||||
maxHeight: 50,
|
||||
paddingHorizontal: spacing.l,
|
||||
paddingVertical: spacing.s,
|
||||
},
|
||||
refreshRow: {
|
||||
paddingHorizontal: spacing.l,
|
||||
paddingBottom: spacing.s,
|
||||
@@ -275,24 +257,6 @@ export default function OrdersScreen() {
|
||||
color: colors.textSecondary,
|
||||
fontSize: fontSize.sm,
|
||||
},
|
||||
filterBtn: {
|
||||
paddingHorizontal: spacing.l,
|
||||
paddingVertical: spacing.s,
|
||||
backgroundColor: colors.bgCard,
|
||||
borderRadius: borderRadius.xl,
|
||||
marginRight: spacing.s,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.border,
|
||||
},
|
||||
filterActive: {
|
||||
backgroundColor: colors.accent,
|
||||
borderColor: colors.accent,
|
||||
},
|
||||
filterText: {
|
||||
color: colors.textSecondary,
|
||||
fontSize: fontSize.sm,
|
||||
},
|
||||
filterTextActive: { color: colors.textWhite },
|
||||
cardText: {
|
||||
color: colors.textSecondary,
|
||||
fontSize: fontSize.sm,
|
||||
@@ -615,31 +579,6 @@ export default function OrdersScreen() {
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<FlatList
|
||||
horizontal
|
||||
data={STATUS_FILTERS}
|
||||
keyExtractor={(i) => i}
|
||||
renderItem={({ item }) => (
|
||||
<TouchableOpacity
|
||||
style={[
|
||||
styles.filterBtn,
|
||||
filter === item && styles.filterActive,
|
||||
]}
|
||||
onPress={() => setFilter(item)}
|
||||
>
|
||||
<Text
|
||||
style={[
|
||||
styles.filterText,
|
||||
filter === item && styles.filterTextActive,
|
||||
]}
|
||||
>
|
||||
{item === "all" ? "Tous" : item}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
style={styles.filterList}
|
||||
showsHorizontalScrollIndicator={false}
|
||||
/>
|
||||
<View style={styles.refreshRow}>
|
||||
<TouchableOpacity
|
||||
style={styles.refreshBtn}
|
||||
|
||||
Reference in New Issue
Block a user