-
-
-
+
+
+
+
+
{inView ? (
) : (
@@ -57,7 +61,7 @@ export const ProfilePage = () => {
diff --git a/src/shared/functions/createStoreContext.tsx b/src/shared/functions/createStoreContext.tsx
index d9e786c..876c018 100644
--- a/src/shared/functions/createStoreContext.tsx
+++ b/src/shared/functions/createStoreContext.tsx
@@ -1,13 +1,15 @@
import { StoreApi, UseBoundStore } from 'zustand';
import { createContext, ReactNode, useContext, useRef } from 'react';
-export const createStoreContext =
(createStore: () => UseBoundStore>) => {
+export const createStoreContext = (
+ createStore: (initialState?: State) => UseBoundStore>,
+) => {
const Context = createContext> | null>(null);
- const Provider = ({ children }: { children: ReactNode }) => {
- const storeRef = useRef>>();
+ const Provider = ({ children, initialState }: { children: ReactNode; initialState?: State }) => {
+ const storeRef = useRef>>();
if (!storeRef.current) {
- storeRef.current = createStore();
+ storeRef.current = createStore(initialState);
}
return {children};
};
diff --git a/src/shared/vo/date.ts b/src/shared/vo/date.ts
index 1208050..76c2137 100644
--- a/src/shared/vo/date.ts
+++ b/src/shared/vo/date.ts
@@ -16,6 +16,14 @@ export const convertDateObjectToDate = ({ year, month, date }: Partial)
return new Date(`${year}-${month}-${date}`);
};
+export const convertDateToDateObject = (date: Date): DateObj => {
+ return {
+ year: date.getFullYear(),
+ month: date.getMonth() + 1,
+ date: date.getDate(),
+ };
+};
+
export const calculateAge = (birthDate: Date) => {
return dayjs(Date.now()).diff(birthDate, 'year');
};
diff --git a/src/widgets/ProfileCardList/ProfileCardList.tsx b/src/widgets/ProfileCardList/ProfileCardList.tsx
index 20fd570..e8d6edc 100644
--- a/src/widgets/ProfileCardList/ProfileCardList.tsx
+++ b/src/widgets/ProfileCardList/ProfileCardList.tsx
@@ -12,7 +12,7 @@ export const ProfileCardList = ({ profileList }: Props) => {
{profileList.map((profile) => (
-
-
+