Restore hotkey navigataion for statuses

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2022-08-12 23:21:44 +02:00
parent aa5b5dbaf6
commit 541521ae6f
3 changed files with 6 additions and 2 deletions

View File

@ -24,11 +24,11 @@ const getStatus = makeGetStatus();
* Legacy Status wrapper accepting a status ID instead of the full entity. * Legacy Status wrapper accepting a status ID instead of the full entity.
* @deprecated Use the Status component directly. * @deprecated Use the Status component directly.
*/ */
const StatusContainer: React.FC<IStatusContainer> = ({ id }) => { const StatusContainer: React.FC<IStatusContainer> = ({ id, onMoveUp, onMoveDown }) => {
const status = useAppSelector(state => getStatus(state, { id })); const status = useAppSelector(state => getStatus(state, { id }));
if (status) { if (status) {
return <Status status={status} />; return <Status status={status} onMoveUp={onMoveUp} onMoveDown={onMoveDown} />;
} else { } else {
return null; return null;
} }

View File

@ -9,6 +9,8 @@ import { useAppSelector } from 'soapbox/hooks';
interface IThreadStatus { interface IThreadStatus {
id: string, id: string,
focusedStatusId: string, focusedStatusId: string,
onMoveUp: (id: string) => void,
onMoveDown: (id: string) => void,
} }
/** Status with reply-connector in threads. */ /** Status with reply-connector in threads. */

View File

@ -369,6 +369,8 @@ const Thread: React.FC<IThread> = (props) => {
key={id} key={id}
id={id} id={id}
focusedStatusId={status!.id} focusedStatusId={status!.id}
onMoveUp={handleMoveUp}
onMoveDown={handleMoveDown}
/> />
); );
}; };