Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: garder le bouton des devoirs non faits visible #452

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
21340a4
set fix width
Filigram Dec 13, 2024
f0a5e1e
add all the code
Filigram Dec 14, 2024
845f61e
Reemove log and comments
Filigram Dec 14, 2024
e6afa8d
Update texts
Filigram Dec 14, 2024
2a89926
Hide circle dashed
Filigram Dec 14, 2024
a2d635f
Change colors
Filigram Dec 14, 2024
0352121
Change title to 'Devoirs'
Filigram Dec 14, 2024
08eb3ca
Add long press for settings
Filigram Dec 15, 2024
0b031ae
Change text again
Filigram Dec 15, 2024
f46d634
Remove lines
Filigram Dec 15, 2024
b19b0bd
change header text to Devoirs
Filigram Dec 15, 2024
6063906
change for keep visible in default
Filigram Dec 15, 2024
55a39f4
Fix long press
Filigram Dec 15, 2024
b0e0765
increase delay
codeuriii Dec 15, 2024
26f79b6
Merge remote-tracking branch 'upstream/main' into keepcheckedbtn
codeuriii Jan 16, 2025
47e3418
Remettre le placeholder a la normal
codeuriii Jan 16, 2025
1fda26a
retirer la page et délocaliser le paramètre
codeuriii Jan 16, 2025
4c3dd01
Change le long press pour un acces direct a la page de parametre
codeuriii Jan 16, 2025
30f7f9f
Change le delau
codeuriii Jan 16, 2025
f99f8d0
Change delay encore
codeuriii Jan 16, 2025
a779c04
Remove import checksquare
codeuriii Jan 16, 2025
51cd29b
Fix de deux trois bugs et terminé
codeuriii Jan 16, 2025
faa4b1d
Merge branch 'PapillonApp:main' into keepcheckedbtn
codeuriii Jan 21, 2025
65c3f6e
Merge branch 'PapillonApp:main' into keepcheckedbtn
codeuriii Jan 21, 2025
bb38587
eslint
codeuriii Jan 21, 2025
13ec0df
Merge branch 'PapillonApp:main' into keepcheckedbtn
codeuriii Jan 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/stores/account/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export interface Personalization {
popupRestauration?: boolean,
magicEnabled?: boolean,
MagicNews?: boolean,
KeepCheckActivated?: boolean,
KeepCheckVisible?: boolean,
MagicHomeworks?: boolean,
notifications?: {
enabled?: boolean
Expand Down
27 changes: 20 additions & 7 deletions src/views/account/Homeworks/Homeworks.tsx
codeuriii marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,18 @@ const WeekView: Screen<"Homeworks"> = ({ route, navigation }) => {
const [direction, setDirection] = useState<"left" | "right">("right");
const [oldSelectedWeek, setOldSelectedWeek] = useState(selectedWeek);

const mutateProperty = useCurrentAccount((store) => store.mutateProperty);

const [hideDone, setHideDone] = useState(false);
useEffect(() => {
const keeyActivated =
account.personalization.KeepCheckActivated === true
? true
: false;

setHideDone(keeyActivated);
}, [account.personalization.KeepCheckActivated]);


const getItemLayout = useCallback((_: any, index: number) => ({
length: finalWidth,
Expand Down Expand Up @@ -445,7 +456,7 @@ const WeekView: Screen<"Homeworks"> = ({ route, navigation }) => {
</Reanimated.View>
}

{!showPickerButtons && hideDone &&
{!showPickerButtons && hideDone && account.personalization.KeepCheckVisible &&
<Reanimated.View
entering={animPapillon(ZoomIn)}
exiting={animPapillon(FadeOut)}
Expand Down Expand Up @@ -538,7 +549,7 @@ const WeekView: Screen<"Homeworks"> = ({ route, navigation }) => {
/>
}

{showPickerButtons && !searchHasFocus && width > 330 &&
{(showPickerButtons || !account.personalization.KeepCheckVisible) && !searchHasFocus && width > 330 &&
<Reanimated.View
layout={animPapillon(LinearTransition)}
entering={animPapillon(FadeInLeft).delay(100)}
Expand All @@ -551,9 +562,9 @@ const WeekView: Screen<"Homeworks"> = ({ route, navigation }) => {
borderWidth: 1,
borderRadius: 800,
height: 40,
width: showPickerButtons ? 40 : null,
minWidth: showPickerButtons ? 40 : null,
maxWidth: showPickerButtons ? 40 : null,
width: 40,
minWidth: 40,
maxWidth: 40,
gap: 4,
shadowColor: "#00000022",
shadowOffset: { width: 0, height: 2 },
Expand All @@ -563,8 +574,11 @@ const WeekView: Screen<"Homeworks"> = ({ route, navigation }) => {
>
<TouchableOpacity
onPress={() => {
mutateProperty("personalization", { KeepCheckActivated: !hideDone });
setHideDone(!hideDone);
}}
onLongPress={() => navigation.navigate("SettingStack", {view: "SettingsTabs"})}
delayLongPress={1000}
>
<CheckSquare
size={20}
Expand Down Expand Up @@ -633,8 +647,7 @@ const WeekView: Screen<"Homeworks"> = ({ route, navigation }) => {
>
<TextInput
placeholder={
(hideDone && !searchHasFocus) ? "Non terminé" :
"Rechercher"
(hideDone && !searchHasFocus) ? "Non terminé" : "Rechercher"
}
value={searchTerms}
onChangeText={setSearchTerms}
Expand Down
25 changes: 25 additions & 0 deletions src/views/settings/SettingsTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
Equal,
SendToBack,
Gift,
CheckSquare,
} from "lucide-react-native";
import {
NestableDraggableFlatList,
Expand Down Expand Up @@ -556,6 +557,30 @@ const SettingsTabs = () => {
</NativeText>
</NativeItem>
</NativeList>

<NativeListHeader label="Devoirs" />

<NativeList>
<NativeItem
trailing={
<Switch
value={account?.personalization?.KeepCheckVisible ?? false}
onValueChange={(value) => mutateProperty("personalization", { KeepCheckVisible: value })}
/>
}
icon={<CheckSquare />}
>
<NativeText
style={{
fontSize: 16,
fontFamily: "semibold",
color: theme.colors.text,
}}
>
Cacher le bouton devoirs non-faits
</NativeText>
</NativeItem>
</NativeList>
</View>
</NestableScrollContainer>
</View>
Expand Down
Loading