feat: fixes and formatter

This commit is contained in:
2026-01-12 16:01:32 +01:00
parent 85c6084351
commit 11e632acff
353 changed files with 23315 additions and 27361 deletions
+26 -42
View File
@@ -1,57 +1,49 @@
import React, { useGlobal } from "reactn";
import { View, Text, Pressable } from "react-native";
import { capitalize } from "lodash";
import moment from "moment";
import { Motion } from "@legendapp/motion";
import { validateDate } from "react-native-minuit/src/actions/dateActions";
import React, { useGlobal } from 'reactn'
import { View, Text, Pressable } from 'react-native'
import { capitalize } from 'lodash'
import moment from 'moment'
import { Motion } from '@legendapp/motion'
import { validateDate } from 'react-native-minuit/src/actions/dateActions'
import { Fonts, Palette, Style } from "../styles";
import { projectsRef } from "../config/firebase";
import { Fonts, Palette, Style } from '../styles'
import { projectsRef } from '../config/firebase'
export default ({ actionList = [] }) => {
const [currentProjectID] = useGlobal("currentProjectID");
const [currentProjectID] = useGlobal('currentProjectID')
const onCheck = async ({ todoID, isChecked = false }) => {
try {
const updatedObject = {
isChecked: !isChecked,
completionTimestamp: !isChecked ? new Date() : null,
};
}
await projectsRef
.doc(currentProjectID)
.collection("todoList")
.collection('todoList')
.doc(todoID)
.update(updatedObject);
.update(updatedObject)
} catch (error) {
console.log("error", error);
console.log('error', error)
}
};
}
if (!actionList.length) {
return (
<Text style={Fonts({ type: "default", style: {} })}>
<Text style={Fonts({ type: 'default', style: {} })}>
Vous n'avez pas d'actions en attente.
</Text>
);
)
}
return actionList.map(
(
{
title = "",
requestedCompletionTimestamp = null,
isChecked = false,
todoID = null,
},
{ title = '', requestedCompletionTimestamp = null, isChecked = false, todoID = null },
index
) => {
return (
<React.Fragment key={index}>
<Pressable
style={Style.containerRow}
onPress={() => onCheck({ todoID, isChecked })}
>
<Pressable style={Style.containerRow} onPress={() => onCheck({ todoID, isChecked })}>
<View style={[Style.containerRadio, { marginRight: 20 }]}>
{isChecked && (
<Motion.View
@@ -65,10 +57,8 @@ export default ({ actionList = [] }) => {
<View>
<Text
style={Fonts({
type: "default",
style: isChecked
? { textDecorationLine: "line-through" }
: {},
type: 'default',
style: isChecked ? { textDecorationLine: 'line-through' } : {},
})}
>
{capitalize(title)}
@@ -76,28 +66,22 @@ export default ({ actionList = [] }) => {
<Text
style={Fonts({
type: "default",
type: 'default',
color: Palette.transparentWhite,
})}
>
{capitalize(
moment(validateDate(requestedCompletionTimestamp)).fromNow()
)}
{capitalize(moment(validateDate(requestedCompletionTimestamp)).fromNow())}
</Text>
</View>
</Pressable>
{index !== actionList.length - 1 && (
<View
style={[
Style.separatorHorizontal,
Style.containerRevertGutter,
{ width: "112%" },
]}
style={[Style.separatorHorizontal, Style.containerRevertGutter, { width: '112%' }]}
/>
)}
</React.Fragment>
);
)
}
);
};
)
}