feat: update memo detail page

This commit is contained in:
Steven
2023-09-23 20:14:07 +08:00
parent 08a81e79dd
commit d4e54f343d
7 changed files with 149 additions and 131 deletions

View File

@ -1 +1,3 @@
export * from "./useLoading";
export * from "./useCurrentUser";
export * from "./useNavigateTo";

View File

@ -0,0 +1,20 @@
import { useNavigate } from "react-router-dom";
const useNavigateTo = () => {
const navigateTo = useNavigate();
const navigateToWithViewTransition = (to: string) => {
const document = window.document as any;
if (!document.startViewTransition) {
navigateTo(to);
} else {
document.startViewTransition(() => {
navigateTo(to);
});
}
};
return navigateToWithViewTransition;
};
export default useNavigateTo;