Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

index.tsx 767B

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