fix(router): Remove ScrollRestoration and improve episodeSkeleton

This commit is contained in:
Prayag Prajapati committed 2024-02-20 11:53:45 +05:30
1 parent 81a2135254
commit ea2e0a6b1c
5 files changed
+14 -5

No files matched your search

+2 -4
View File
@@ -5,10 +5,8 @@ import { AnimatePresence, motion } from "framer-motion";
import { SnackbarProvider } from "notistack";
import {
Navigate,
Outlet,
Route,
Routes,
ScrollRestoration,
useLocation,
useNavigate,
} from "react-router-dom";
@@ -224,7 +222,6 @@ function App() {
return <AppReady />;
}
function AppReady() {
const [audioPlayerVisible] = useAudioPlayback((state) => [state.display]);
const { enqueueSnackbar } = useSnackbar();
@@ -251,6 +248,8 @@ function AppReady() {
const isQueryFetching = useIsFetching();
const isMutating = useIsMutating();
useEffect(() => window.scrollTo(0, 0), [location.key]);
useLayoutEffect(() => {
async function checkForUpdates() {
try {
@@ -288,7 +287,6 @@ function AppReady() {
<SnackbarProvider maxSnack={5}>
<ThemeProvider theme={theme}>
<CssBaseline />
<ScrollRestoration />
<NProgress
isAnimating={isQueryFetching}
key={isQueryFetching || isMutating ? "fetching" : "notFetching"}
+1
View File
@@ -24,6 +24,7 @@ const NProgress: React.FC<{ isAnimating: boolean | number }> = ({
>
<LinearProgress
sx={{
height: 3,
transitionDuration: animationDuration,
}}
value={progress * 100}
@@ -63,6 +63,7 @@ export const SeasonSelectorSkeleton = () => {
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
opacity: 0.1,
}}
/>
</CardMedia>
@@ -80,6 +81,7 @@ export const SeasonSelectorSkeleton = () => {
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
opacity: 0.1,
}}
/>
</Typography>
@@ -91,6 +93,7 @@ export const SeasonSelectorSkeleton = () => {
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
opacity: 0.1,
}}
/>
<Skeleton
@@ -99,6 +102,7 @@ export const SeasonSelectorSkeleton = () => {
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
opacity: 0.1,
}}
/>
@@ -108,6 +112,7 @@ export const SeasonSelectorSkeleton = () => {
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
opacity: 0.1,
}}
/>
</Typography>
+1 -1
View File
@@ -1,6 +1,6 @@
import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter as Router } from "react-router-dom";
import { MemoryRouter as Router } from "react-router-dom";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+5
View File
@@ -934,6 +934,7 @@ const SeriesTitlePage = () => {
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
opacity: 0.1,
}}
/>
</CardMedia>
@@ -951,6 +952,7 @@ const SeriesTitlePage = () => {
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
opacity: 0.1,
}}
/>
</Typography>
@@ -962,6 +964,7 @@ const SeriesTitlePage = () => {
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
opacity: 0.1,
}}
/>
<Skeleton
@@ -970,6 +973,7 @@ const SeriesTitlePage = () => {
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
opacity: 0.1,
}}
/>
@@ -979,6 +983,7 @@ const SeriesTitlePage = () => {
animationDelay: `${index * 0.2}s`,
animationDuration: "1.4s",
animationName: "pulse",
opacity: 0.1,
}}
/>
</Typography>