index.js
902 Bytes
import React, { useEffect } from "react";
import Layout from "../../../components/layout/Layout";
import MyGiftCard from "../../../components/user/MyGiftCard";
import { getGiftCard } from "../../../redux/actions/giftCardAction";
import { wrapper } from "../../../redux/store";
import { useDispatch } from "react-redux";
import { getCurrentEndUser } from "../../../redux/actions/userActions";
export default function UserGiftCardPage() {
const dispatch = useDispatch()
useEffect(() => {
dispatch(getCurrentEndUser())
}, [])
return (
<Layout>
<MyGiftCard />
</Layout>
);
};
/** For server side rendering */
export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => {
try {
// await store.dispatch(getGiftCard())
return {
props: {},
};
} catch (error) {
}
});