disable uitextview

This commit is contained in:
Hailey
2024-08-04 21:19:28 -07:00
parent 862fdfcba4
commit 9b02d3f01b
3 changed files with 27 additions and 21 deletions
+8 -1
View File
@@ -57,7 +57,14 @@ export function Text({style, selectable, ...rest}: TextProps) {
const t = useTheme() const t = useTheme()
const s = normalizeTextStyles([atoms.text_sm, t.atoms.text, flatten(style)]) const s = normalizeTextStyles([atoms.text_sm, t.atoms.text, flatten(style)])
return <UITextView selectable={selectable} uiTextView style={s} {...rest} /> return (
<UITextView
selectable={selectable}
// uiTextView
style={s}
{...rest}
/>
)
} }
export function createHeadingElement({level}: {level: number}) { export function createHeadingElement({level}: {level: number}) {
+18 -19
View File
@@ -2,7 +2,6 @@ import React, {
ComponentProps, ComponentProps,
forwardRef, forwardRef,
useCallback, useCallback,
useMemo,
useRef, useRef,
useState, useState,
} from 'react' } from 'react'
@@ -31,7 +30,7 @@ import {
LinkFacetMatch, LinkFacetMatch,
suggestLinkCardUri, suggestLinkCardUri,
} from 'view/com/composer/text-input/text-input-util' } from 'view/com/composer/text-input/text-input-util'
import {Text} from 'view/com/util/text/Text' // import {Text} from 'view/com/util/text/Text'
import {Autocomplete} from './mobile/Autocomplete' import {Autocomplete} from './mobile/Autocomplete'
export interface TextInputRef { export interface TextInputRef {
@@ -180,22 +179,22 @@ export const TextInput = forwardRef(function TextInputImpl(
[onChangeText, richtext, setAutocompletePrefix], [onChangeText, richtext, setAutocompletePrefix],
) )
const textDecorated = useMemo(() => { // const textDecorated = useMemo(() => {
let i = 0 // let i = 0
//
return Array.from(richtext.segments()).map(segment => { // return Array.from(richtext.segments()).map(segment => {
return ( // return (
<Text // <Text
key={i++} // key={i++}
style={[ // style={[
segment.facet ? pal.link : pal.text, // segment.facet ? pal.link : pal.text,
styles.textInputFormatting, // // styles.textInputFormatting,
]}> // ]}>
{segment.text} // {segment.text}
</Text> // </Text>
) // )
}) // })
}, [richtext, pal.link, pal.text]) // }, [richtext, pal.link, pal.text])
return ( return (
<View style={styles.container}> <View style={styles.container}>
@@ -220,7 +219,7 @@ export const TextInput = forwardRef(function TextInputImpl(
{textAlignVertical: 'top'}, {textAlignVertical: 'top'},
]} ]}
{...props}> {...props}>
{textDecorated} {/*{textDecorated}*/}
</PasteInput> </PasteInput>
<Autocomplete <Autocomplete
prefix={autocompletePrefix} prefix={autocompletePrefix}
+1 -1
View File
@@ -38,7 +38,7 @@ export function Text({
<UITextView <UITextView
style={[s.black, typography, lineHeightStyle, style]} style={[s.black, typography, lineHeightStyle, style]}
selectable={selectable} selectable={selectable}
uiTextView // uiTextView
{...props}> {...props}>
{children} {children}
</UITextView> </UITextView>