1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Spoiler now supports emoji as well

This commit is contained in:
xmflsct
2022-09-19 22:01:13 +02:00
parent 2df23a8a2e
commit b44370d3ec
5 changed files with 37 additions and 37 deletions

View File

@ -362,8 +362,20 @@ const ScreenCompose: React.FC<RootStackScreenProps<'Screen-Compose'>> = ({
composeState.text.selection,
selection => composeDispatch({ type: 'text', payload: { selection } })
],
isFocused: useRef<boolean>(composeState.textInputFocus.current === 'text'),
maxLength: maxTootChars
isFocused: composeState.textInputFocus.isFocused.text,
maxLength: maxTootChars - (composeState.spoiler.active ? composeState.spoiler.count : 0)
},
{
value: [
composeState.spoiler.raw,
content => formatText({ textInput: 'spoiler', composeDispatch, content })
],
selection: [
composeState.spoiler.selection,
selection => composeDispatch({ type: 'spoiler', payload: { selection } })
],
isFocused: composeState.textInputFocus.isFocused.spoiler,
maxLength: maxTootChars - composeState.text.count
}
]