Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

index.js 679B

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