Profile redesign: Show yourself in follower list (#37813)
This commit is contained in:
13 files changed
+474
-375
No files matched your search
@@ -8,6 +8,7 @@ export const useLayout = () => {
|
||||
|
||||
return {
|
||||
singleColumn: layout === 'single-column' || layout === 'mobile',
|
||||
multiColumn: layout === 'multi-column',
|
||||
layout,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { fetchRelationships } from '../actions/accounts';
|
||||
import { useAppDispatch, useAppSelector } from '../store';
|
||||
|
||||
export function useRelationship(accountId?: string | null) {
|
||||
const relationship = useAppSelector((state) =>
|
||||
accountId ? state.relationships.get(accountId) : null,
|
||||
);
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
useEffect(() => {
|
||||
if (accountId && !relationship) {
|
||||
dispatch(fetchRelationships([accountId]));
|
||||
}
|
||||
}, [accountId, dispatch, relationship]);
|
||||
|
||||
return relationship;
|
||||
}
|
||||
Reference in new issue
Block a user