Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.3",
"@vercel/analytics": "^2.0.1",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"framer-motion": "^12.38.0",
Expand Down
18 changes: 11 additions & 7 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Suspense } from "react";
import { Outlet } from "react-router-dom";
import { Analytics } from "@vercel/analytics/react";
import Sidebar from "./components/sidebar/Sidebar";
import InfoBar from "./components/molecules/Infobar";
import Loader from "./components/atoms/Loader";
Expand All @@ -8,13 +9,16 @@ import ContentArea from "./components/organisms/ContentArea";

function App() {
return (
<LearningLayout sidebar={<Sidebar />} header={<InfoBar />}>
<ContentArea>
<Suspense fallback={<Loader />}>
<Outlet />
</Suspense>
</ContentArea>
</LearningLayout>
<>
<LearningLayout sidebar={<Sidebar />} header={<InfoBar />}>
<ContentArea>
<Suspense fallback={<Loader />}>
<Outlet />
</Suspense>
</ContentArea>
</LearningLayout>
<Analytics />
</>
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/pages/Hooks/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ const HooksComponents = {
"use-click-outside": lazy(() => import("./UseClickOutsideHook")),
"use-window-size": lazy(() => import("./UseWindowSizeHook")),
"use-key-press": lazy(() => import("./UseKeyPressHook")),
"use-throttle": lazy(() => import("./useThrottleHook")),
"use-throttle": lazy(() => import("./UseThrottleHook")),
"use-undo-redo": lazy(() => import("./UseUndoRedoHook")),
"use-infinite-scroll": lazy(() => import("./useInfiniteScrollHook")),
"use-infinite-scroll": lazy(() => import("./UseInfiniteScrollHook")),
};

const Hooks = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Hooks/useInfiniteScrollHook.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const useInfiniteScroll = (callback, Threshold = 20) => {
return handleScroll;
};

const useInfiniteScrollHook = () => {
const UseInfiniteScrollHook = () => {
const [data, setData] = useState([...new Array(40)]);
const handleScroll = useInfiniteScroll(() => {
setData((prev) => [...prev, ...new Array(10)]);
Expand Down Expand Up @@ -71,4 +71,4 @@ const useInfiniteScrollHook = () => {
);
};

export default useInfiniteScrollHook;
export default UseInfiniteScrollHook;
4 changes: 2 additions & 2 deletions src/pages/Hooks/useThrottleHook.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const useThrottle = (callback, delay = 500) => {
return throttleFn;
};

const useThrottleHook = () => {
const UseThrottleHook = () => {
const [count, setCount] = useState(0);
const [inputValue, setInputValue] = useState("");
const throttledValue = useThrottleValue(inputValue, 5000);
Expand Down Expand Up @@ -100,4 +100,4 @@ const useThrottleHook = () => {
);
};

export default useThrottleHook;
export default UseThrottleHook;
4 changes: 2 additions & 2 deletions src/pages/Hooks/useUndoRedoHook.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const useUndoRedo = (initialValues) => {
return { set, history, undo, redo };
};

const useUndoRedoHook = () => {
const UseUndoRedoHook = () => {
const { set, history, undo, redo } = useUndoRedo("");
return (
<>
Expand Down Expand Up @@ -123,4 +123,4 @@ const useUndoRedoHook = () => {
);
};

export default useUndoRedoHook;
export default UseUndoRedoHook;