mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
made transitional Anchor component for next/cra
This commit is contained in:
parent
7658068caa
commit
14b93d5dbb
7 changed files with 44 additions and 18 deletions
|
@ -7,6 +7,7 @@ import { INode } from '~/types';
|
|||
import { getPrettyDate } from '~/utils/dom';
|
||||
import { URLS } from '~/constants/urls';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useNavigation } from '~/hooks/navigation/useNavigation';
|
||||
|
||||
interface IProps {
|
||||
node?: Partial<INode>;
|
||||
|
@ -14,10 +15,10 @@ interface IProps {
|
|||
}
|
||||
|
||||
const LabHero: FC<IProps> = ({ node, isLoading }) => {
|
||||
const history = useHistory();
|
||||
const { push } = useNavigation();
|
||||
const onClick = useCallback(() => {
|
||||
history.push(URLS.NODE_URL(node?.id));
|
||||
}, [history, node]);
|
||||
push(URLS.NODE_URL(node?.id));
|
||||
}, [push, node]);
|
||||
|
||||
if (!node || isLoading) {
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue