feat(web): Add new About page #258
This commit is contained in:
34 files changed
+1749
-758
No files matched your search
@@ -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]);
|
||||
}
|
||||
@@ -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;
|
||||
@@ -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,
|
||||
};
|
||||
Reference in new issue
Block a user