feat(web): Add new About page #258

This commit is contained in:
Prayag Prajapati committed 2024-02-17 16:56:58 +05:30
1 parent bf89f35ddd
commit b155daa83b
34 files changed
+1749 -758

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
import { MotionValue, useTransform } from "framer-motion";
export default function useParallax(
value: MotionValue<number>,
distance: number,
) {
return useTransform(value, [0, 1], [-distance, distance]);
}
+16
View File
@@ -0,0 +1,16 @@
import { matchPath, useLocation } from "react-router-dom";
function useRouteMatch(patterns: readonly string[]) {
const { pathname } = useLocation();
for (let i = 0; i < patterns.length; i += 1) {
const pattern = patterns[i];
const possibleMatch = matchPath(pattern, pathname);
if (possibleMatch !== null) {
return possibleMatch;
}
}
return null;
}
export default useRouteMatch;
+19
View File
@@ -0,0 +1,19 @@
import { create } from "zustand";
const useSettingsStore = create(() => ({
dialogOpen: false,
tabValue: 0,
}));
const setDialogOpen = (dialog: boolean) =>
useSettingsStore.setState((state) => ({ ...state, dialogOpen: dialog }));
const setTabValue = (value: number) => {
useSettingsStore.setState((state) => ({ ...state, tabValue: value }));
};
export default useSettingsStore;
export {
setDialogOpen as setSettingsDialogOpen,
setTabValue as setSettingsTabValue,
};