Skip to content

Commit c7888d3

Browse files
committed
fix(mobile): improve button press feedback on Home and subfolder screens
1 parent 3b20c2b commit c7888d3

File tree

2 files changed

+53
-17
lines changed

2 files changed

+53
-17
lines changed

apps/mobile/v1/src/screens/FolderNotes/components/NotesList/SubfoldersList.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ export const SubfoldersList: React.FC<SubfoldersListProps> = ({
7878
{/* Create Folder Button */}
7979
<Pressable
8080
onPress={onCreateFolderPress}
81-
android_ripple={{ color: theme.colors.muted }}
81+
style={({ pressed }) => [
82+
viewMode === 'grid' ? styles.pressableItemGrid : styles.pressableItem,
83+
pressed && { opacity: 0.6 }
84+
]}
8285
>
8386
<GlassView
8487
glassEffectStyle="regular"
@@ -100,15 +103,15 @@ export const SubfoldersList: React.FC<SubfoldersListProps> = ({
100103
{subfolders.map((subfolder) => (
101104
<Pressable
102105
key={subfolder.id}
103-
style={[
106+
style={({ pressed }) => [
104107
viewMode === 'grid' ? styles.subfolderItemGrid : styles.subfolderItem,
105108
{
106109
backgroundColor: viewMode === 'grid' ? subfolder.color || '#000000' : theme.colors.card,
107110
borderColor: theme.colors.border
108-
}
111+
},
112+
pressed && { opacity: 0.6 }
109113
]}
110114
onPress={() => onFolderPress(subfolder.id, subfolder.name)}
111-
android_ripple={{ color: theme.colors.muted }}
112115
>
113116
<View style={viewMode === 'grid' ? styles.subfolderContentGrid : styles.subfolderContent}>
114117
{viewMode === 'list' && (
@@ -133,6 +136,12 @@ export const SubfoldersList: React.FC<SubfoldersListProps> = ({
133136
};
134137

135138
const styles = StyleSheet.create({
139+
pressableItem: {
140+
borderRadius: 12,
141+
},
142+
pressableItemGrid: {
143+
borderRadius: 12,
144+
},
136145
sectionHeader: {
137146
flexDirection: 'row',
138147
justifyContent: 'space-between',

apps/mobile/v1/src/screens/Home/index.tsx

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { GlassView } from 'expo-glass-effect';
77
import { LinearGradient } from 'expo-linear-gradient';
88
import { useRouter } from 'expo-router';
99
import React, { useCallback,useEffect, useMemo, useRef, useState } from 'react';
10-
import { ActivityIndicator, Alert, Animated, Dimensions, Image, Keyboard, RefreshControl, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
10+
import { ActivityIndicator, Alert, Animated, Dimensions, Image, Keyboard, Pressable, RefreshControl, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
1111
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
1212

1313
import { CreateFileSheet, CreateFileSheetRef } from '../../components/CreateFileSheet';
@@ -405,14 +405,18 @@ export default function HomeScreen() {
405405
</Text>
406406
<View style={styles.specialViewsList}>
407407
{SPECIAL_VIEWS.map((view) => (
408-
<TouchableOpacity
408+
<Pressable
409409
key={view.id}
410410
onPress={() => {
411411
router.push({
412412
pathname: '/folder-notes',
413413
params: { viewType: view.id }
414414
});
415415
}}
416+
style={({ pressed }) => [
417+
styles.pressableItem,
418+
pressed && { opacity: 0.6 }
419+
]}
416420
>
417421
<GlassView glassEffectStyle="regular" style={[styles.glassSpecialViewItem, { backgroundColor: theme.isDark ? 'rgba(255, 255, 255, 0.01)' : 'rgba(0, 0, 0, 0.01)' }]} pointerEvents="none">
418422
<View style={styles.specialViewItem}>
@@ -431,7 +435,7 @@ export default function HomeScreen() {
431435
</View>
432436
</View>
433437
</GlassView>
434-
</TouchableOpacity>
438+
</Pressable>
435439
))}
436440
</View>
437441
</View>
@@ -494,7 +498,13 @@ export default function HomeScreen() {
494498
<View style={viewMode === 'grid' ? styles.foldersGrid : styles.foldersList}>
495499
{/* Create Folder Button */}
496500
{viewMode === 'grid' ? (
497-
<TouchableOpacity onPress={() => createFolderSheetRef.current?.present()}>
501+
<Pressable
502+
onPress={() => createFolderSheetRef.current?.present()}
503+
style={({ pressed }) => [
504+
styles.pressableItemGrid,
505+
pressed && { opacity: 0.7 }
506+
]}
507+
>
498508
<GlassView
499509
glassEffectStyle="regular"
500510
style={[
@@ -516,9 +526,15 @@ export default function HomeScreen() {
516526
</View>
517527
</View>
518528
</GlassView>
519-
</TouchableOpacity>
529+
</Pressable>
520530
) : (
521-
<TouchableOpacity onPress={() => createFolderSheetRef.current?.present()}>
531+
<Pressable
532+
onPress={() => createFolderSheetRef.current?.present()}
533+
style={({ pressed }) => [
534+
styles.pressableItem,
535+
pressed && { opacity: 0.6 }
536+
]}
537+
>
522538
<GlassView
523539
glassEffectStyle="regular"
524540
style={[
@@ -536,19 +552,20 @@ export default function HomeScreen() {
536552
</View>
537553
</View>
538554
</GlassView>
539-
</TouchableOpacity>
555+
</Pressable>
540556
)}
541557

542558
{allFolders.map((folder) => (
543559
viewMode === 'grid' ? (
544-
<TouchableOpacity
560+
<Pressable
545561
key={folder.id}
546-
style={[
562+
style={({ pressed }) => [
547563
styles.folderItemGrid,
548564
{
549565
backgroundColor: folder.color || '#000000',
550566
borderColor: theme.colors.border
551-
}
567+
},
568+
pressed && { opacity: 0.7 }
552569
]}
553570
onPress={() => {
554571
router.push({
@@ -562,16 +579,20 @@ export default function HomeScreen() {
562579
{folder.name}
563580
</Text>
564581
</View>
565-
</TouchableOpacity>
582+
</Pressable>
566583
) : (
567-
<TouchableOpacity
584+
<Pressable
568585
key={folder.id}
569586
onPress={() => {
570587
router.push({
571588
pathname: '/folder-notes',
572589
params: { folderId: folder.id, folderName: folder.name }
573590
});
574591
}}
592+
style={({ pressed }) => [
593+
styles.pressableItem,
594+
pressed && { opacity: 0.6 }
595+
]}
575596
>
576597
<GlassView glassEffectStyle="regular" style={[styles.glassFolderItem, { backgroundColor: theme.isDark ? 'rgba(255, 255, 255, 0.01)' : 'rgba(0, 0, 0, 0.01)' }]} pointerEvents="none">
577598
<View style={styles.folderItem}>
@@ -588,7 +609,7 @@ export default function HomeScreen() {
588609
</View>
589610
</View>
590611
</GlassView>
591-
</TouchableOpacity>
612+
</Pressable>
592613
)
593614
))}
594615
</View>
@@ -763,6 +784,12 @@ const styles = StyleSheet.create({
763784
container: {
764785
flex: 1,
765786
},
787+
pressableItem: {
788+
borderRadius: 12,
789+
},
790+
pressableItemGrid: {
791+
borderRadius: 12,
792+
},
766793
loadingContainer: {
767794
position: 'absolute',
768795
top: 0,

0 commit comments

Comments
 (0)