Skip to content

Commit 0cc8818

Browse files
authored
Merge pull request #32 from MyTaskly/feature-global-task-search
refined the modal and the compoents to search the tasks and add a comeplte translaions for it
2 parents 93bafb7 + 05ee58b commit 0cc8818

4 files changed

Lines changed: 81 additions & 28 deletions

File tree

src/components/Task/GlobalTaskSearch.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,24 @@ const styles = StyleSheet.create({
275275
backgroundColor: "#ffffff",
276276
},
277277
header: {
278+
position: "relative",
278279
paddingTop: 60, // Per lo spazio della status bar
279280
paddingHorizontal: 16,
280281
paddingBottom: 16,
281282
backgroundColor: "#ffffff",
282283
borderBottomWidth: 1,
283284
borderBottomColor: "#e1e5e9",
284285
},
286+
dragHandle: {
287+
position: "absolute",
288+
top: 32,
289+
alignSelf: "center",
290+
width: 44,
291+
height: 4,
292+
borderRadius: 2,
293+
backgroundColor: "#d1d5db",
294+
marginBottom: 12,
295+
},
285296
headerTop: {
286297
flexDirection: "row",
287298
justifyContent: "space-between",
@@ -290,7 +301,7 @@ const styles = StyleSheet.create({
290301
},
291302
title: {
292303
fontSize: 28,
293-
fontWeight: "200",
304+
fontWeight: "700",
294305
color: "#000000",
295306
fontFamily: "System",
296307
letterSpacing: -1.5,
@@ -303,14 +314,6 @@ const styles = StyleSheet.create({
303314
padding: 8,
304315
marginLeft: 8,
305316
},
306-
statsContainer: {
307-
marginTop: 12,
308-
},
309-
statsText: {
310-
fontSize: 14,
311-
color: "#666666",
312-
fontFamily: "System",
313-
},
314317
content: {
315318
flex: 1,
316319
},

src/locales/en.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,19 @@
570570
"friday": "Fri",
571571
"saturday": "Sat",
572572
"sunday": "Sun"
573+
},
574+
"commitmentsOf": "Events for",
575+
"loadingEvents": "Loading events...",
576+
"noEventsForDate": "No events for this date",
577+
"syncing": "Sync...",
578+
"defaultCategory": "Calendar",
579+
"errors": {
580+
"title": "Error",
581+
"completeFailed": "Unable to complete the task. Please try again.",
582+
"reopenFailed": "Unable to reopen the task. Please try again.",
583+
"editFailed": "Unable to edit the task. Please try again.",
584+
"warningTitle": "Warning",
585+
"localSaveWarning": "Task added locally but error saving to server."
573586
}
574587
},
575588
"calendar20": {
@@ -598,6 +611,11 @@
598611
"categories": "Categories",
599612
"showAll": "Show all",
600613
"settings": "Settings"
614+
},
615+
"loadMore": "Load more",
616+
"duration": {
617+
"hour": "1 hour",
618+
"hours": "{{count}} hours"
601619
}
602620
},
603621
"statistics": {

src/locales/it.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,19 @@
571571
"friday": "Ven",
572572
"saturday": "Sab",
573573
"sunday": "Dom"
574+
},
575+
"commitmentsOf": "Impegni del",
576+
"loadingEvents": "Caricamento impegni...",
577+
"noEventsForDate": "Nessun impegno per questa data",
578+
"syncing": "Sincronizzazione...",
579+
"defaultCategory": "Calendario",
580+
"errors": {
581+
"title": "Errore",
582+
"completeFailed": "Impossibile completare il task. Riprova.",
583+
"reopenFailed": "Impossibile riaprire il task. Riprova.",
584+
"editFailed": "Impossibile modificare il task. Riprova.",
585+
"warningTitle": "Attenzione",
586+
"localSaveWarning": "Task aggiunto localmente ma errore nel salvataggio sul server."
574587
}
575588
},
576589
"calendar20": {
@@ -597,7 +610,13 @@
597610
"drawer": {
598611
"views": "Viste",
599612
"categories": "Categorie",
600-
"showAll": "Mostra tutto"
613+
"showAll": "Mostra tutto",
614+
"settings": "Impostazioni"
615+
},
616+
"loadMore": "Carica altri",
617+
"duration": {
618+
"hour": "1 ora",
619+
"hours": "{{count}} ore"
601620
}
602621
},
603622
"statistics": {

src/navigation/screens/Categories.tsx

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { StatusBar } from 'expo-status-bar';
1010
import { useFocusEffect } from "@react-navigation/native";
1111
import CategoryList from "../../components/Category/CategoryList";
1212
import AddCategoryButton from "../../components/Category/AddCategoryButton";
13-
import SearchTasksButton from "../../components/UI/SearchTasksButton";
1413
import GlobalTaskSearch from "../../components/Task/GlobalTaskSearch";
1514
import { useTranslation } from "react-i18next";
1615
import { TaskCacheService } from "../../services/TaskCacheService";
@@ -20,6 +19,7 @@ import {
2019
ScreenContainer,
2120
ScreenHeader,
2221
} from "../../components/UI/foundation";
22+
import { MaterialIcons } from "@expo/vector-icons";
2323

2424
export default function Categories() {
2525
const { t } = useTranslation();
@@ -69,7 +69,20 @@ export default function Categories() {
6969
<ScreenContainer>
7070
<StatusBar style="dark" />
7171

72-
<ScreenHeader title={t("categories.title")} />
72+
<ScreenHeader
73+
title={t("categories.title")}
74+
style={{ paddingEnd: 35 }}
75+
rightActions={(
76+
<TouchableOpacity
77+
onPress={handleOpenSearch}
78+
style={styles.searchIconButton}
79+
accessibilityRole="button"
80+
accessibilityLabel={t("globalTaskSearch.searchAllTasks")}
81+
>
82+
<MaterialIcons name="search" size={22} color="#333333" />
83+
</TouchableOpacity>
84+
)}
85+
/>
7386

7487
<ScrollView
7588
style={styles.content}
@@ -85,12 +98,6 @@ export default function Categories() {
8598
}
8699
>
87100
<ContentContainer padded={false}>
88-
<View style={styles.searchContainer}>
89-
<SearchTasksButton
90-
onPress={handleOpenSearch}
91-
style={styles.searchButton}
92-
/>
93-
</View>
94101
<CategoryList ref={categoryListRef} />
95102
</ContentContainer>
96103
<View style={styles.addButtonContainer}>
@@ -113,17 +120,23 @@ const styles = StyleSheet.create({
113120
scrollContent: {
114121
flexGrow: 1,
115122
},
116-
searchContainer: {
117-
flexDirection: "row",
123+
searchIconButton: {
124+
width: 36,
125+
height: 36,
126+
borderRadius: 18,
127+
backgroundColor: "#ffffff",
128+
borderWidth: 1,
129+
borderColor: "#e1e5e9",
130+
justifyContent: "center",
118131
alignItems: "center",
119-
paddingHorizontal: 16,
120-
marginVertical: 8,
121-
},
122-
searchButton: {
123-
flex: 1,
124-
marginHorizontal: 0, // Override default margin
125-
marginRight: 10,
126-
marginVertical: 0, // Override default margin
132+
shadowColor: "#000",
133+
shadowOffset: {
134+
width: 0,
135+
height: 2,
136+
},
137+
shadowOpacity: 0.04,
138+
shadowRadius: 4,
139+
elevation: 1,
127140
},
128141
reloadButton: {
129142
width: 44,

0 commit comments

Comments
 (0)