Replace glitch-soc's collapsed toots with upstream's “Read more” (#2916)

* Remove glitch-soc's post collapse feature

* Get rid of the infamous `parseClick`

* Remove unused CSS

* Use upstream's “Read More” implementation

* Update translation strings
This commit is contained in:
Claire
2024-12-22 20:27:32 +01:00
committed by GitHub
parent 28751ff042
commit d65f6c2f8a
17 changed files with 203 additions and 644 deletions

View File

@@ -63,19 +63,6 @@ export const Conversation = ({ conversation, scrollKey, onMoveUp, onMoveDown })
const sharedCWState = useSelector(state => state.getIn(['state', 'content_warnings', 'shared_state']));
const [expanded, setExpanded] = useState(undefined);
const parseClick = useCallback((e, destination) => {
if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) {
if (destination === undefined) {
if (unread) {
dispatch(markConversationRead(id));
}
destination = `/statuses/${lastStatus.get('id')}`;
}
history.push(destination);
e.preventDefault();
}
}, [dispatch, history, unread, id, lastStatus]);
const handleMouseEnter = useCallback(({ currentTarget }) => {
if (autoPlayGif) {
return;
@@ -215,7 +202,7 @@ export const Conversation = ({ conversation, scrollKey, onMoveUp, onMoveDown })
<StatusContent
status={lastStatus}
parseClick={parseClick}
onClick={handleClick}
expanded={sharedCWState ? lastStatus.get('hidden') : expanded}
onExpandedToggle={handleShowMore}
collapsible