mirror of
https://github.com/tooot-app/app
synced 2025-04-21 21:57:32 +02:00
Improved history diff
This commit is contained in:
parent
06324ee51a
commit
bb9fa0c752
@ -1,4 +1,5 @@
|
|||||||
Enjoy toooting! This version includes following improvements and fixes:
|
Enjoy toooting! This version includes following improvements and fixes:
|
||||||
|
- Auto fetch remote content in conversations!
|
||||||
- Allowing adding more context of reports
|
- Allowing adding more context of reports
|
||||||
- Option to disable autoplay gif
|
- Option to disable autoplay gif
|
||||||
- Hide boosts from users
|
- Hide boosts from users
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
toooting愉快!此版本包括以下改进和修复:
|
toooting愉快!此版本包括以下改进和修复:
|
||||||
|
- 主动获取对话的远程内容
|
||||||
- 可添加举报细节
|
- 可添加举报细节
|
||||||
- 新增暂停自动播放gif动画选项
|
- 新增暂停自动播放gif动画选项
|
||||||
- 隐藏用户的转嘟
|
- 隐藏用户的转嘟
|
||||||
|
@ -7,11 +7,11 @@ import { useTranslation } from 'react-i18next'
|
|||||||
import StatusContext from '../Context'
|
import StatusContext from '../Context'
|
||||||
|
|
||||||
const HeaderSharedApplication: React.FC = () => {
|
const HeaderSharedApplication: React.FC = () => {
|
||||||
const { status } = useContext(StatusContext)
|
const { status, isConversation } = useContext(StatusContext)
|
||||||
const { colors } = useTheme()
|
const { colors } = useTheme()
|
||||||
const { t } = useTranslation('componentTimeline')
|
const { t } = useTranslation('componentTimeline')
|
||||||
|
|
||||||
return status?.application?.name && status.application.name !== 'Web' ? (
|
return !isConversation && status?.application?.name && status.application.name !== 'Web' ? (
|
||||||
<CustomText
|
<CustomText
|
||||||
fontStyle='S'
|
fontStyle='S'
|
||||||
accessibilityRole='link'
|
accessibilityRole='link'
|
||||||
|
@ -50,6 +50,17 @@ const ContentView: React.FC<{
|
|||||||
const changesContent = withoutBoundary
|
const changesContent = withoutBoundary
|
||||||
? diffChars(removeHTML(prevItem?.content || item.content), removeHTML(item.content))
|
? diffChars(removeHTML(prevItem?.content || item.content), removeHTML(item.content))
|
||||||
: diffWords(removeHTML(prevItem?.content || item.content), removeHTML(item.content))
|
: diffWords(removeHTML(prevItem?.content || item.content), removeHTML(item.content))
|
||||||
|
const changesPoll = item.poll
|
||||||
|
? item.poll.options.map((option, index) =>
|
||||||
|
withoutBoundary
|
||||||
|
? prevItem?.poll?.options[index].title
|
||||||
|
? diffChars(prevItem?.poll?.options[index].title, option.title)
|
||||||
|
: undefined
|
||||||
|
: prevItem?.poll?.options[index].title
|
||||||
|
? diffWords(prevItem?.poll?.options[index].title, option.title)
|
||||||
|
: undefined
|
||||||
|
)
|
||||||
|
: null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -92,12 +103,28 @@ const ContentView: React.FC<{
|
|||||||
paddingTop: StyleConstants.Font.LineHeight.M - StyleConstants.Font.Size.M,
|
paddingTop: StyleConstants.Font.LineHeight.M - StyleConstants.Font.Size.M,
|
||||||
marginRight: StyleConstants.Spacing.S
|
marginRight: StyleConstants.Spacing.S
|
||||||
}}
|
}}
|
||||||
name='Circle'
|
name={item.poll?.multiple ? 'Square' : 'Circle'}
|
||||||
size={StyleConstants.Font.Size.M}
|
size={StyleConstants.Font.Size.M}
|
||||||
color={colors.disabled}
|
color={
|
||||||
|
prevItem?.poll?.multiple !== item.poll?.multiple ? colors.red : colors.disabled
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<CustomText style={{ flex: 1 }}>
|
<CustomText style={{ flex: 1, color: colors.primaryDefault }}>
|
||||||
|
{changesPoll?.[index]?.length ? (
|
||||||
|
changesPoll[index]?.map(({ value, added, removed }, index) => (
|
||||||
|
<ParseEmojis
|
||||||
|
key={index}
|
||||||
|
content={value}
|
||||||
|
emojis={item.poll?.emojis}
|
||||||
|
style={{
|
||||||
|
color: added ? colors.green : removed ? colors.red : undefined,
|
||||||
|
textDecorationLine: removed ? 'line-through' : undefined
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
<ParseEmojis content={option.title} emojis={item.poll?.emojis} />
|
<ParseEmojis content={option.title} emojis={item.poll?.emojis} />
|
||||||
|
)}
|
||||||
</CustomText>
|
</CustomText>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
@ -368,7 +368,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
|||||||
})
|
})
|
||||||
: null}
|
: null}
|
||||||
{/* <CustomText
|
{/* <CustomText
|
||||||
children={data?.body[index - 1]?._level}
|
children={finalData.current[index - 1]?._level}
|
||||||
style={{ position: 'absolute', top: 4, left: 4, color: colors.red }}
|
style={{ position: 'absolute', top: 4, left: 4, color: colors.red }}
|
||||||
/>
|
/>
|
||||||
<CustomText
|
<CustomText
|
||||||
@ -376,7 +376,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
|
|||||||
style={{ position: 'absolute', top: 20, left: 4, color: colors.yellow }}
|
style={{ position: 'absolute', top: 20, left: 4, color: colors.yellow }}
|
||||||
/>
|
/>
|
||||||
<CustomText
|
<CustomText
|
||||||
children={data?.body[index + 1]?._level}
|
children={finalData.current[index + 1]?._level}
|
||||||
style={{ position: 'absolute', top: 36, left: 4, color: colors.green }}
|
style={{ position: 'absolute', top: 36, left: 4, color: colors.green }}
|
||||||
/> */}
|
/> */}
|
||||||
</View>
|
</View>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user