Skip to content

Commit bccd1a2

Browse files
committed
Add Markdown input to Test screen, update navigation, and adjust keyboard offset
1 parent 431d328 commit bccd1a2

File tree

6 files changed

+25
-28
lines changed

6 files changed

+25
-28
lines changed

App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export type RootStackParamList = {
109109
CustomizingAnimations: undefined
110110
Basic: undefined
111111
KeyboardAnimation: undefined
112-
Animations: undefined
112+
// Animations: undefined
113113
DragAnimation: undefined
114114
Weather: undefined
115115
WeatherWelcome: undefined

bun.lockb

7.35 KB
Binary file not shown.

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"prettier:fix": "prettier --write ."
2020
},
2121
"dependencies": {
22+
"@expensify/react-native-live-markdown": "^0.1.219",
2223
"@react-native-clipboard/clipboard": "^1.16.1",
2324
"@react-native-community/netinfo": "^11.4.1",
2425
"@react-native-masked-view/masked-view": "^0.3.2",
@@ -28,7 +29,9 @@
2829
"@shopify/react-native-skia": "^1.10.2",
2930
"@tanstack/react-query": "^5.64.1",
3031
"clsx": "^2.1.1",
32+
"expensify-common": "^2.0.114",
3133
"hono": "^4.6.16",
34+
"html-entities": "^2.5.2",
3235
"lottie-react-native": "^7.2.1",
3336
"nativewind": "^4.1.23",
3437
"react": "18.3.1",

src/components/KeyboardAvoid.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function KeyboardAvoid(props: KeyboardAvoidingContainerProps) {
2222
<KeyboardAvoidingView
2323
style={{ flex: 1 }}
2424
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
25-
// keyboardVerticalOffset={Platform.OS === 'ios' ? 0 : 0}
25+
keyboardVerticalOffset={Platform.OS === 'ios' ? 0 : 10}
2626
enabled={isKeyboardVisible}
2727
>
2828
<ScrollView

src/screens/Home/HomeScreen.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function Shortcuts({ navigation }: { navigation: StackNav }) {
114114
<Medium className='text-xs text-gray-700 dark:text-gray-300'>Shortcut 1</Medium>
115115
</TouchableOpacity>
116116
<TouchableOpacity
117-
onPress={() => navigation.navigate('Story')}
117+
onPress={() => navigation.navigate('Test')}
118118
style={[hw, styles.shadow, styles.center]}
119119
className='w-1/2 rounded-2xl bg-white dark:bg-zinc-900'
120120
>

src/screens/Test.tsx

+19-25
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
1-
import { Setting07SolidIcon } from '@assets/icons/icons'
2-
import { Gap12 } from '@components/Gap'
3-
import RoundedIcon from '@components/RoundedIcon'
4-
import SettGroup from '@components/Settings/SettGroup'
5-
import { SettOption } from '@components/Settings/SettOption'
6-
import SettText from '@components/Settings/SettText'
71
import SettWrapper from '@components/Settings/SettWrapper'
2+
import { MarkdownTextInput, parseExpensiMark } from '@expensify/react-native-live-markdown'
3+
import { Colors } from '@utils/colors'
4+
import { H } from '@utils/dimensions'
5+
import { MEDIUM } from '@utils/fonts'
86
import type { NavProp } from '@utils/types'
7+
import { useState } from 'react'
98

109
export default function Test({ navigation }: NavProp) {
10+
const [text, setText] = useState('')
1111
return (
1212
<>
13-
<SettWrapper navigation={navigation} title='Test Screen'>
14-
<Gap12>
15-
<SettText className='mt-3'>This is a test screen.</SettText>
16-
<SettGroup title='Sample title'>
17-
<SettOption
18-
title='A blank setting'
19-
Icon={<RoundedIcon Icon={Setting07SolidIcon} className='bg-slate-500' />}
20-
arrow
21-
/>
22-
<SettOption
23-
title='Animations'
24-
Icon={<RoundedIcon Icon={Setting07SolidIcon} className='bg-slate-500' />}
25-
arrow
26-
onPressOut={() => navigation.navigate('Animations')}
27-
/>
28-
</SettGroup>
29-
<SettText>Sample text</SettText>
30-
</Gap12>
31-
<SettText>End Text</SettText>
13+
<SettWrapper navigation={navigation} title='Test Markdown' className='px-2'>
14+
<MarkdownTextInput
15+
value={text}
16+
onChangeText={setText}
17+
keyboardType='twitter'
18+
className='text'
19+
parser={parseExpensiMark}
20+
numberOfLines={100}
21+
style={{ ...MEDIUM, flex: 1, textAlignVertical: 'top', height: H - 100 }}
22+
selectionColor={Colors.accent + '77'}
23+
cursorColor={Colors.accent}
24+
multiline
25+
/>
3226
</SettWrapper>
3327
</>
3428
)

0 commit comments

Comments
 (0)