You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.tsx 728B

1234567891011121314151617181920212223242526272829303132
  1. import { NextPage } from 'next';
  2. import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
  3. import nookies from 'nookies';
  4. import CheckoutContent from '../../components/checkout-content/CheckoutContent';
  5. const CheckoutPage: NextPage = () => {
  6. return <CheckoutContent></CheckoutContent>;
  7. };
  8. export const getServerSideProps = async (ctx: any) => {
  9. const cookies = nookies.get(ctx);
  10. if (!cookies['checkout-session']) {
  11. return {
  12. redirect: {
  13. destination: '/cart',
  14. permanent: false,
  15. },
  16. };
  17. }
  18. return {
  19. props: {
  20. ...(await serverSideTranslations(ctx.locale, [
  21. 'checkout',
  22. 'addressForm',
  23. ])),
  24. },
  25. };
  26. };
  27. export default CheckoutPage;