Blame view

pages/user/giftcard/index.js 902 Bytes
1
import React, { useEffect } from "react";
2 3
import Layout from "../../../components/layout/Layout";
import MyGiftCard from "../../../components/user/MyGiftCard";
Ravindra Kanojiya committed
4 5
import { getGiftCard } from "../../../redux/actions/giftCardAction";
import { wrapper } from "../../../redux/store";
6 7
import { useDispatch } from "react-redux";
import { getCurrentEndUser } from "../../../redux/actions/userActions";
8

9 10 11 12 13
export default function UserGiftCardPage() {
    const dispatch = useDispatch()
    useEffect(() => {
        dispatch(getCurrentEndUser())
    }, [])
14 15 16 17 18 19

    return (
        <Layout>
            <MyGiftCard />
        </Layout>
    );
Ravindra Kanojiya committed
20 21 22 23 24
};

/** For server side rendering */
export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => {
    try {
jaymehta committed
25
        // await store.dispatch(getGiftCard())
26 27 28 29

        return {
            props: {},
        };
Ravindra Kanojiya committed
30 31 32
    } catch (error) {
    }
});