Skip to content

Commit 56b3067

Browse files
committed
Refactor Input component styles and enhance MMKVDataEditor and MMKVDataList for improved readability and animation
1 parent 24b13f5 commit 56b3067

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

src/components/Input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function Input({ Icon, Right, accent = Colors.accent, multiline, classNam
2020
style={[{ fontSize: 12.5, marginBottom: 1, paddingVertical: 0, flex: 1 }, SEMIBOLD]}
2121
placeholderTextColor={scheme === 'dark' ? Colors.zinc[500] : Colors.zinc[400]}
2222
cursorColor={accent}
23-
selectionColor={accent + '55'}
23+
selectionColor={accent + '77'}
2424
selectionHandleColor={accent}
2525
placeholder='Default placeholder'
2626
textAlignVertical={multiline ? 'top' : 'center'}

src/screens/DeveloperOptions/MMKVDataEditor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export default function MMKVDataEditor({
115115
</SettGroup>
116116
)}
117117
<SettText>
118-
Be careful when {!isNew ? 'editing' : ' adding'} MMKV data. Wrong data can cause the app to crash. And make
118+
Be careful when {!isNew ? 'editing' : ' adding'} MMKV data. Wrong data can cause the app to crash and make
119119
all data unreadable.
120120
</SettText>
121121
<SettGroup title='Value'>
@@ -124,7 +124,7 @@ export default function MMKVDataEditor({
124124
value={value}
125125
onChangeText={setValue}
126126
multiline
127-
style={{ fontFamily: 'monospace', fontWeight: 'bold', lineHeight: 24 }}
127+
style={{ fontFamily: 'monospace', fontWeight: 'bold', lineHeight: 18, fontSize: 12 }}
128128
autoCorrect={false}
129129
/>
130130
</SettGroup>

src/screens/DeveloperOptions/MMKVDataList.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ import { useIsFocused } from '@react-navigation/native'
1313
import { Colors } from '@utils/colors'
1414
import { ls, type StorageKeys } from '@utils/storage'
1515
import type { NavProp } from '@utils/types'
16-
import { screenDelay } from '@utils/utils'
16+
import { delayedFadeAnimationSearch, screenDelay } from '@utils/utils'
1717
import React, { useEffect } from 'react'
1818
import { View } from 'react-native'
19+
import Animated from 'react-native-reanimated'
1920

2021
export default function MMKVDataList({ navigation }: NavProp) {
2122
const state = useIsFocused()
@@ -64,16 +65,16 @@ export default function MMKVDataList({ navigation }: NavProp) {
6465

6566
<SettGroup title='Stored keys' className='pb-4'>
6667
{searchResults?.map((item, i) => (
67-
// <Animated.View key={item} entering={delayedFadeAnimationSearch(search, i)}>
68-
<SettOption
69-
title={item}
70-
arrow
71-
key={item}
72-
numberOfLines={1}
73-
Icon={<RoundedIcon Icon={Database02SolidIcon} className='bg-slate-500' />}
74-
onPress={() => navigation.navigate('MMKVDataEditor', { key: item as StorageKeys })}
75-
/>
76-
// </Animated.View>
68+
<Animated.View key={item} entering={delayedFadeAnimationSearch(search, i)}>
69+
<SettOption
70+
title={item}
71+
arrow
72+
key={item}
73+
numberOfLines={1}
74+
Icon={<RoundedIcon Icon={Database02SolidIcon} className='bg-slate-500' />}
75+
onPress={() => navigation.navigate('MMKVDataEditor', { key: item as StorageKeys })}
76+
/>
77+
</Animated.View>
7778
))}
7879
{initStorage?.length === 0 && (
7980
<>

src/screens/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function TabBar({ state, descriptors, navigation }: BottomTabBarProps) {
7777
onPress={onPress}
7878
onLongPress={onLongPress}
7979
className='flex items-center justify-center p-1'
80-
style={{ flex: 1, paddingTop: 13, paddingBottom: 5 }}
80+
style={{ flex: 1, paddingTop: 13, paddingBottom: 8 }}
8181
>
8282
{options.tabBarIcon && options.tabBarIcon({ focused: isFocused, color, size: 22 })}
8383
<SemiBold style={{ color, marginTop: 4, fontSize: 8.5 }}>{label as ReactNode}</SemiBold>

0 commit comments

Comments
 (0)