styling of thread message input

This commit is contained in:
Roland Osborne 2025-03-26 15:48:48 -07:00
parent 5249ffda99
commit 38a637e5cb
4 changed files with 6 additions and 2 deletions

View File

@ -161,6 +161,7 @@ export const styles = StyleSheet.create({
width: '100%',
fontSize: 14,
padding: 0,
maxHeight: 256,
},
controls: {
display: 'flex',

View File

@ -289,7 +289,6 @@ export function Conversation({close, openDetails, wide}: {close: () => void; ope
editable={!sending}
textColor={state.textColorSet ? state.textColor : undefined}
outlineColor="transparent"
activeOutlineColor="transparent"
spellcheck={false}
autoComplete="off"
autoCapitalize="none"

View File

@ -199,6 +199,9 @@ export function Conversation({ openDetails }: { openDetails: () => void }) {
<div className={classes.files}>{media}</div>
<Textarea
ref={input}
autosize={true}
maxRows={8}
minRows={2}
className={classes.message}
placeholder={state.strings.newMessage}
styles={{ input: { color: state.textColorSet ? state.textColor : undefined, fontSize: state.textSizeSet ? state.textSize : undefined } }}

View File

@ -124,6 +124,7 @@ export function Message({ topic, card, profile, host }: { topic: Topic; card: Ca
useEffect(() => {
const urlPattern = new RegExp('(https?:\\/\\/)?(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,4}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)')
const hostPattern = new RegExp('^https?:\\/\\/', 'i')
const dotPattern = new RegExp('^.*\\.\\..*$')
let plain = ''
const clickable = []
@ -132,7 +133,7 @@ export function Message({ topic, card, profile, host }: { topic: Topic; card: Ca
if (parsed?.length > 0) {
const words = parsed as string[]
words.forEach((word, index) => {
if (urlPattern.test(word)) {
if (urlPattern.test(word) && !dotPattern.test(word)) {
clickable.push(<span key={index}>{plain}</span>)
plain = ''
const url = hostPattern.test(word) ? word : `https://${word}`