-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update lesson sidebar to use lessonId and fetch course data dyna…
…mically (#353) * fix: update lesson sidebar to use lessonId and fetch course data dynamically * fix: pass handleNext prop to Quiz component for improved navigation after quiz submission
- Loading branch information
1 parent
ad1424a
commit 6023948
Showing
8 changed files
with
79 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,42 @@ | ||
import { QueryClientProvider } from "@tanstack/react-query"; | ||
import { lazy, Suspense, useEffect, useState } from "react"; | ||
import { createPortal } from "react-dom"; | ||
|
||
import { queryClient } from "../../api/queryClient"; | ||
import { ThemeProvider } from "../Theme/ThemeProvider"; | ||
|
||
const ReactQueryDevtools = lazy(() => | ||
import("@tanstack/react-query-devtools").then(({ ReactQueryDevtools }) => ({ | ||
default: ReactQueryDevtools, | ||
})), | ||
); | ||
|
||
export function Providers({ children }: { children: React.ReactNode }) { | ||
const [mounted, setMounted] = useState(false); | ||
|
||
/* | ||
* awful hack but this is the only way (I found) to make react-query devtools work in our remix | ||
*/ | ||
useEffect(() => { | ||
setMounted(true); | ||
}, []); | ||
|
||
return ( | ||
<ThemeProvider> | ||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider> | ||
<QueryClientProvider client={queryClient}> | ||
{children} | ||
|
||
{mounted && process.env.NODE_ENV === "development" && ( | ||
<> | ||
{createPortal( | ||
<Suspense fallback={null}> | ||
<ReactQueryDevtools initialIsOpen={false} /> | ||
</Suspense>, | ||
document.body, | ||
)} | ||
</> | ||
)} | ||
</QueryClientProvider> | ||
</ThemeProvider> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.