Skip to content

Commit 9eb018b

Browse files
CopilotGabry848
andcommitted
Apply black/white theme consistency to all chat components
Co-authored-by: Gabry848 <118192073+Gabry848@users.noreply.github.com>
1 parent c310aef commit 9eb018b

5 files changed

Lines changed: 36 additions & 147 deletions

File tree

src/components/BotChat/widgets/ErrorWidgetCard.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ const styles = StyleSheet.create({
4141
container: {
4242
flexDirection: 'row',
4343
alignItems: 'center',
44-
backgroundColor: '#FFE5E5',
44+
backgroundColor: '#FFFFFF',
4545
borderRadius: 12,
4646
padding: 12,
4747
marginVertical: 8,
48-
borderWidth: 1,
49-
borderColor: '#FFCCCC',
48+
borderWidth: 1.5,
49+
borderColor: '#E1E5E9',
50+
borderLeftWidth: 4,
51+
borderLeftColor: '#FF3B30',
5052
},
5153
iconContainer: {
5254
marginRight: 12,

src/components/BotChat/widgets/InlineCategoryList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const InlineCategoryList: React.FC<InlineCategoryListProps> = React.memo(({ widg
8282
)}
8383

8484
{/* Arrow icon */}
85-
<Ionicons name="chevron-forward" size={20} color="#CCCCCC" />
85+
<Ionicons name="chevron-forward" size={20} color="#999999" />
8686
</TouchableOpacity>
8787
);
8888
})}
@@ -96,7 +96,7 @@ const styles = StyleSheet.create({
9696
marginVertical: 4,
9797
},
9898
emptyContainer: {
99-
backgroundColor: '#F5F5F5',
99+
backgroundColor: '#F8F8F8',
100100
borderRadius: 12,
101101
padding: 16,
102102
alignItems: 'center',

src/components/BotChat/widgets/InlineTaskPreview.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const styles = StyleSheet.create({
100100
marginVertical: 4,
101101
},
102102
emptyContainer: {
103-
backgroundColor: '#F5F5F5',
103+
backgroundColor: '#F8F8F8',
104104
borderRadius: 12,
105105
padding: 16,
106106
alignItems: 'center',
@@ -112,11 +112,13 @@ const styles = StyleSheet.create({
112112
fontStyle: 'italic',
113113
},
114114
moreTasksContainer: {
115-
backgroundColor: '#F0F0F0',
115+
backgroundColor: '#FFFFFF',
116116
borderRadius: 8,
117117
padding: 12,
118118
alignItems: 'center',
119119
marginTop: 4,
120+
borderWidth: 1,
121+
borderColor: '#E1E5E9',
120122
},
121123
moreTasksText: {
122124
fontSize: 13,

src/components/BotChat/widgets/ItemDetailModal.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ const ItemDetailModal: React.FC<ItemDetailModalProps> = ({
230230
: 'document-text'
231231
}
232232
size={48}
233-
color={itemType === 'note' ? '#FFFFFF' : '#007AFF'}
233+
color={itemType === 'note' ? '#FFFFFF' : '#000000'}
234234
/>
235235
</View>
236236
</View>
@@ -316,7 +316,7 @@ const styles = StyleSheet.create({
316316
width: 100,
317317
height: 100,
318318
borderRadius: 50,
319-
backgroundColor: '#E5F1FF',
319+
backgroundColor: '#F0F0F0',
320320
alignItems: 'center',
321321
justifyContent: 'center',
322322
},
@@ -347,20 +347,20 @@ const styles = StyleSheet.create({
347347
lineHeight: 24,
348348
},
349349
completedText: {
350-
color: '#34C759',
350+
color: '#000000',
351351
fontWeight: '600',
352352
},
353353
categoryBadge: {
354354
alignSelf: 'flex-start',
355-
backgroundColor: '#E5F1FF',
355+
backgroundColor: '#F0F0F0',
356356
borderRadius: 12,
357357
paddingHorizontal: 12,
358358
paddingVertical: 6,
359359
},
360360
categoryBadgeText: {
361361
fontSize: 14,
362362
fontWeight: '600',
363-
color: '#007AFF',
363+
color: '#000000',
364364
},
365365
actionsContainer: {
366366
paddingHorizontal: 16,
@@ -379,10 +379,10 @@ const styles = StyleSheet.create({
379379
gap: 8,
380380
},
381381
primaryButton: {
382-
backgroundColor: '#007AFF',
382+
backgroundColor: '#000000',
383383
},
384384
destructiveButton: {
385-
backgroundColor: '#FF3B30',
385+
backgroundColor: '#666666',
386386
},
387387
actionButtonText: {
388388
fontSize: 16,

src/components/BotChat/widgets/VisualizationModal.tsx

Lines changed: 18 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { VisualizationModalProps, TaskListItem } from '../types';
1515
import Task from '../../Task/Task';
1616
import { Task as TaskType } from '../../../services/taskService';
1717
import CalendarGrid from '../../Calendar/CalendarGrid';
18+
import Category from '../../Category/Category';
1819
import dayjs from 'dayjs';
1920

2021
/**
@@ -239,63 +240,26 @@ const VisualizationModal: React.FC<VisualizationModalProps> = ({
239240
}
240241

241242
if (isCategoryList) {
242-
// Usa imageUrl solo se è un URL valido (inizia con http/https/file://)
243-
// Altrimenti lascia undefined per usare l'icona predefinita
244-
const validImageUrl = item.imageUrl || item.icon;
245-
const isValidUrl = validImageUrl && (
246-
validImageUrl.startsWith('http://') ||
247-
validImageUrl.startsWith('https://') ||
248-
validImageUrl.startsWith('file://')
249-
);
250-
251243
return (
252-
<TouchableOpacity
244+
<Category
253245
key={index}
254-
style={styles.categoryCard}
255-
activeOpacity={0.7}
256-
onPress={() => {
257-
console.log('[VisualizationModal] Category pressed:', item.name);
258-
console.log('[VisualizationModal] onCategoryPress available:', !!onCategoryPress);
259-
if (onCategoryPress) {
260-
onCategoryPress(item);
261-
} else {
262-
console.warn('[VisualizationModal] onCategoryPress is not defined!');
263-
}
246+
title={item.name}
247+
description={item.description}
248+
imageUrl={item.imageUrl || item.icon}
249+
categoryId={item.id || item.category_id}
250+
isShared={item.isShared || item.is_shared}
251+
isOwned={item.isOwned !== undefined ? item.isOwned : true}
252+
ownerName={item.ownerName || item.owner_name}
253+
permissionLevel={item.permissionLevel || item.permission_level || "READ_WRITE"}
254+
onDelete={() => {
255+
// Refresh modal data if needed
256+
console.log('[VisualizationModal] Category deleted:', item.name);
264257
}}
265-
>
266-
<View style={styles.categoryIconContainer}>
267-
{isValidUrl ? (
268-
<Image source={{ uri: validImageUrl }} style={styles.categoryImage} />
269-
) : (
270-
<Ionicons name="folder" size={32} color="#007AFF" />
271-
)}
272-
</View>
273-
<View style={styles.categoryTextContainer}>
274-
<Text style={styles.categoryTitle} numberOfLines={1}>
275-
{item.name}
276-
</Text>
277-
{item.description && (
278-
<Text style={styles.categoryDescription} numberOfLines={2}>
279-
{item.description}
280-
</Text>
281-
)}
282-
<View style={styles.categoryMetaContainer}>
283-
<View style={styles.categoryTaskCount}>
284-
<Ionicons name="list-outline" size={14} color="#666666" />
285-
<Text style={styles.categoryTaskCountText}>
286-
{item.taskCount || item.task_count || 0} task
287-
</Text>
288-
</View>
289-
{item.isShared && (
290-
<View style={styles.categorySharedBadge}>
291-
<Ionicons name="people-outline" size={14} color="#007AFF" />
292-
<Text style={styles.categorySharedText}>Condiviso</Text>
293-
</View>
294-
)}
295-
</View>
296-
</View>
297-
<Ionicons name="chevron-forward" size={20} color="#C7C7CC" />
298-
</TouchableOpacity>
258+
onEdit={() => {
259+
// Refresh modal data if needed
260+
console.log('[VisualizationModal] Category edited:', item.name);
261+
}}
262+
/>
299263
);
300264
}
301265

@@ -815,85 +779,6 @@ const styles = StyleSheet.create({
815779
color: '#FFFFFF',
816780
fontFamily: 'System',
817781
},
818-
// Stili per le category card personalizzate nella chat
819-
categoryCard: {
820-
flexDirection: 'row',
821-
alignItems: 'center',
822-
backgroundColor: '#FFFFFF',
823-
borderRadius: 12,
824-
paddingHorizontal: 16,
825-
paddingVertical: 14,
826-
marginBottom: 12,
827-
marginHorizontal: 16,
828-
shadowColor: '#000',
829-
shadowOffset: { width: 0, height: 1 },
830-
shadowOpacity: 0.05,
831-
shadowRadius: 3,
832-
elevation: 1,
833-
borderWidth: 1.5,
834-
borderColor: '#E1E5E9',
835-
},
836-
categoryIconContainer: {
837-
width: 48,
838-
height: 48,
839-
borderRadius: 24,
840-
backgroundColor: '#E5F1FF',
841-
alignItems: 'center',
842-
justifyContent: 'center',
843-
marginRight: 12,
844-
overflow: 'hidden',
845-
},
846-
categoryImage: {
847-
width: 48,
848-
height: 48,
849-
borderRadius: 24,
850-
},
851-
categoryTextContainer: {
852-
flex: 1,
853-
},
854-
categoryTitle: {
855-
fontSize: 17,
856-
fontWeight: '600',
857-
color: '#000000',
858-
marginBottom: 4,
859-
fontFamily: 'System',
860-
},
861-
categoryDescription: {
862-
fontSize: 14,
863-
color: '#666666',
864-
marginBottom: 6,
865-
fontFamily: 'System',
866-
},
867-
categoryMetaContainer: {
868-
flexDirection: 'row',
869-
alignItems: 'center',
870-
gap: 12,
871-
},
872-
categoryTaskCount: {
873-
flexDirection: 'row',
874-
alignItems: 'center',
875-
gap: 4,
876-
},
877-
categoryTaskCountText: {
878-
fontSize: 13,
879-
color: '#666666',
880-
fontFamily: 'System',
881-
},
882-
categorySharedBadge: {
883-
flexDirection: 'row',
884-
alignItems: 'center',
885-
gap: 4,
886-
backgroundColor: '#E5F1FF',
887-
paddingHorizontal: 8,
888-
paddingVertical: 2,
889-
borderRadius: 8,
890-
},
891-
categorySharedText: {
892-
fontSize: 12,
893-
color: '#007AFF',
894-
fontWeight: '600',
895-
fontFamily: 'System',
896-
},
897782
});
898783

899784
export default VisualizationModal;

0 commit comments

Comments
 (0)